Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into coverage/opportunity-outside-range-c1-c2
- Loading branch information
Showing
8 changed files
with
213 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
...omer-requested-cancellation/implemented/patch-contains-excessive-properties-error-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* eslint-disable no-unused-vars */ | ||
const chakram = require('chakram'); | ||
const { RequestState } = require('../../../../helpers/request-state'); | ||
const { FlowHelper } = require('../../../../helpers/flow-helper'); | ||
const { FeatureHelper } = require('../../../../helpers/feature-helper'); | ||
const { GetMatch, C1, C2, B } = require('../../../../shared-behaviours'); | ||
const { itShouldReturnAnOpenBookingError } = require('../../../../shared-behaviours/errors'); | ||
|
||
const { expect } = chakram; | ||
/* eslint-enable no-unused-vars */ | ||
|
||
FeatureHelper.describeFeature(module, { | ||
testCategory: 'cancellation', | ||
testFeature: 'customer-requested-cancellation', | ||
testFeatureImplemented: true, | ||
testIdentifier: 'patch-contains-excessive-properties-error', | ||
testName: 'Successful booking and unsuccessful cancellation due to PatchContainsExcessivePropertiesError', | ||
testDescription: 'PatchContainsExcessivePropertiesError returned because patch request includes other properties than @type, @context, orderProposalStatus and orderCustomerNote', | ||
// The primary opportunity criteria to use for the primary OrderItem under test | ||
testOpportunityCriteria: 'TestOpportunityBookableCancellable', | ||
// The secondary opportunity criteria to use for multiple OrderItem tests | ||
controlOpportunityCriteria: 'TestOpportunityBookable', | ||
// TODO: Refactor 'Orders Feed' tests so they work with multiple OrderItems | ||
skipMultiple: true, | ||
}, | ||
function (configuration, orderItemCriteria, featureIsImplemented, logger) { | ||
const state = new RequestState(logger, { uReqTemplateRef: 'excessiveProperties' }); | ||
const flow = new FlowHelper(state); | ||
|
||
beforeAll(async function () { | ||
await state.fetchOpportunities(orderItemCriteria); | ||
|
||
return chakram.wait(); | ||
}); | ||
|
||
afterAll(async function () { | ||
await state.deleteOrder(); | ||
return chakram.wait(); | ||
}); | ||
|
||
describe('Get Opportunity Feed Items', function () { | ||
(new GetMatch({ | ||
state, flow, logger, orderItemCriteria, | ||
})) | ||
.beforeSetup() | ||
.successChecks() | ||
.validationTests(); | ||
}); | ||
|
||
describe('C1', function () { | ||
(new C1({ | ||
state, flow, logger, | ||
})) | ||
.beforeSetup() | ||
.successChecks() | ||
.validationTests(); | ||
}); | ||
|
||
describe('C2', function () { | ||
(new C2({ | ||
state, flow, logger, | ||
})) | ||
.beforeSetup() | ||
.successChecks() | ||
.validationTests(); | ||
}); | ||
|
||
describe('B', function () { | ||
(new B({ | ||
state, flow, logger, | ||
})) | ||
.beforeSetup() | ||
.successChecks() | ||
.validationTests(); | ||
}); | ||
|
||
describe('Orders Feed', function () { | ||
beforeAll(async function () { | ||
await flow.U(); | ||
}); | ||
|
||
itShouldReturnAnOpenBookingError('PatchContainsExcessivePropertiesError', 400, () => state.uResponse); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...tegration-tests/test/features/core/agent-broker/implemented/customer-not-included-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* eslint-disable no-unused-vars */ | ||
const chakram = require('chakram'); | ||
const { FeatureHelper } = require('../../../../helpers/feature-helper'); | ||
const { GetMatch, C1, C2, B } = require('../../../../shared-behaviours'); | ||
const { FlowHelper } = require('../../../../helpers/flow-helper'); | ||
const { RequestState } = require('../../../../helpers/request-state'); | ||
const { itShouldReturnAnOpenBookingError } = require('../../../../shared-behaviours/errors'); | ||
|
||
/* eslint-enable no-unused-vars */ | ||
|
||
FeatureHelper.describeFeature(module, { | ||
testCategory: 'core', | ||
testFeature: 'agent-broker', | ||
testFeatureImplemented: true, | ||
testIdentifier: 'customer-not-included', | ||
testName: 'Customer not included in Order in AgentBroker mode', | ||
testDescription: 'If customer is not included in Order in AgentBroker mode for B request, request shoud fail, returning 400 status code and IncompleteCustomerDetailsError.', | ||
// The primary opportunity criteria to use for the primary OrderItem under test | ||
testOpportunityCriteria: 'TestOpportunityBookable', | ||
// The secondary opportunity criteria to use for multiple OrderItem tests | ||
controlOpportunityCriteria: 'TestOpportunityBookable', | ||
}, | ||
function (configuration, orderItemCriteria, featureIsImplemented, logger) { | ||
const state = new RequestState(logger, { bReqTemplateRef: 'noCustomer' }); | ||
const flow = new FlowHelper(state); | ||
|
||
describe('Booking should fail as Customer is not included in Order', () => { | ||
beforeAll(async function () { | ||
await state.fetchOpportunities(orderItemCriteria); | ||
return chakram.wait(); | ||
}); | ||
|
||
describe('Get Opportunity Feed Items', () => { | ||
(new GetMatch({ | ||
state, flow, logger, orderItemCriteria, | ||
})) | ||
.beforeSetup() | ||
.successChecks() | ||
.validationTests(); | ||
}); | ||
|
||
describe('C1', () => { | ||
(new C1({ | ||
state, flow, logger, | ||
})) | ||
.beforeSetup() | ||
.successChecks() | ||
.validationTests(); | ||
}); | ||
|
||
describe('C2', function () { | ||
(new C2({ | ||
state, flow, logger, | ||
})) | ||
.beforeSetup() | ||
.successChecks() | ||
.validationTests(); | ||
}); | ||
|
||
describe('B', function () { | ||
(new B({ | ||
state, flow, logger, | ||
})) | ||
.beforeSetup() | ||
.itResponseReceived() | ||
.validationTests(); | ||
|
||
itShouldReturnAnOpenBookingError('IncompleteCustomerDetailsError', 400, () => state.bResponse); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters