-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(named-leasing): Add lease-opportunity-capacity-update test (#211)
- Loading branch information
1 parent
f189f53
commit b7127b6
Showing
10 changed files
with
138 additions
and
3 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
49 changes: 49 additions & 0 deletions
49
.../test/features/restrictions/booking-window/implemented/opportunity-in-range-c1-c2-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,49 @@ | ||
const { FeatureHelper } = require('../../../../helpers/feature-helper'); | ||
const { GetMatch, C1, C2 } = require('../../../../shared-behaviours'); | ||
|
||
/** | ||
* @typedef {import('chakram').ChakramResponse} ChakramResponse | ||
*/ | ||
|
||
FeatureHelper.describeFeature(module, { | ||
testCategory: 'restriction', | ||
testFeature: 'booking-window', | ||
testFeatureImplemented: true, | ||
testIdentifier: 'opportunity-in-range-c1-c2', | ||
testName: 'Running C1 and C2 for opportunity in range should succeed', | ||
testDescription: 'Booking an opportunity within the specified booking window', | ||
testOpportunityCriteria: 'TestOpportunityBookableWithinValidFromBeforeStartDate', | ||
controlOpportunityCriteria: 'TestOpportunityBookable', | ||
}, | ||
(configuration, orderItemCriteria, featureIsImplemented, logger, state, flow) => { | ||
beforeAll(async () => { | ||
await state.fetchOpportunities(orderItemCriteria); | ||
}); | ||
|
||
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', () => { | ||
(new C2({ | ||
state, flow, logger, | ||
})) | ||
.beforeSetup() | ||
.successChecks() | ||
.validationTests(); | ||
}); | ||
}); |
1 change: 1 addition & 0 deletions
1
...-criteria/built-types/criteria/TestOpportunityBookableWithinValidFromBeforeStartDate.d.ts
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 @@ | ||
export const TestOpportunityBookableWithinValidFromBeforeStartDate: import("../types/Criteria").Criteria; |
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
18 changes: 18 additions & 0 deletions
18
...-interface-criteria/src/criteria/TestOpportunityBookableWithinValidFromBeforeStartDate.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,18 @@ | ||
const { InternalTestOpportunityBookable } = require('./internal/InternalTestOpportunityBookable'); | ||
const { createCriteria, mustBeWithinBookingWindow } = require('./criteriaUtils'); | ||
|
||
const TestOpportunityBookableWithinValidFromBeforeStartDate = createCriteria({ | ||
name: 'TestOpportunityBookableWithinValidFromBeforeStartDate', | ||
opportunityConstraints: [], | ||
offerConstraints: [ | ||
[ | ||
'Must be within booking window', | ||
mustBeWithinBookingWindow, | ||
], | ||
], | ||
includeConstraintsFromCriteria: InternalTestOpportunityBookable, | ||
}); | ||
|
||
module.exports = { | ||
TestOpportunityBookableWithinValidFromBeforeStartDate, | ||
}; |
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