-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(server): added server.summary() and hasSummary() functions #1080
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ import { SecurityRequirement } from '../../../src/models/v2/security-requirement | |
const doc = { | ||
development: { | ||
protocol: 'mqtt', | ||
summary: 'mqtt development server is summary', | ||
protocolVersion: '1.0.0', | ||
url: 'development.gigantic-server.com', | ||
variables: { | ||
|
@@ -43,6 +44,21 @@ describe('Server Model', function () { | |
}); | ||
}); | ||
|
||
describe('.summary()', function () { | ||
it('should return value', function () { | ||
expect(docItem.summary()).toEqual(doc.development.summary); | ||
}); | ||
}); | ||
|
||
describe('.hasSummary()', function () { | ||
it('should return true if summary is present', function () { | ||
expect(docItem.hasSummary()).toEqual(true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should test the opposite as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like for a case where the summary isn't present? |
||
}); | ||
it('should return false if summary is missing', function () { | ||
expect(emptyItem.hasSummary()).toEqual(false); | ||
}); | ||
}); | ||
|
||
describe('.hasProtocolVersion()', function () { | ||
it('should return true if protocolVersion is not missing', function () { | ||
expect(docItem.hasProtocolVersion()).toBeTruthy(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ import { xParserObjectUniqueId } from '../../../src/constants'; | |
const doc = { | ||
production: { | ||
host: 'rabbitmq.in.mycompany.com:5672', | ||
summary: 'rabbitmq production server is summary', | ||
pathname: '/production', | ||
protocol: 'amqp', | ||
protocolVersion: '1.0.0', | ||
|
@@ -45,6 +46,21 @@ describe('Server Model', function () { | |
}); | ||
}); | ||
|
||
describe('.summary()', function () { | ||
it('should return value', function () { | ||
expect(docItem.summary()).toEqual(doc.production.summary); | ||
}); | ||
}); | ||
|
||
describe('.hasSummary()', function () { | ||
it('should return true if summary is present', function () { | ||
expect(docItem.hasSummary()).toEqual(true); | ||
}); | ||
it('should return false if summary is missing', function () { | ||
expect(emptyItem.hasSummary()).toEqual(false); | ||
}); | ||
}); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
describe('.host()', function () { | ||
it('should return value', function () { | ||
expect(docItem.host()).toEqual(doc.production.host); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this.