-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathopportunity-paid-test.js
24 lines (22 loc) · 1.35 KB
/
opportunity-paid-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const { FeatureHelper } = require('../../../../helpers/feature-helper');
const { FlowStageRecipes, FlowStageUtils } = require('../../../../helpers/flow-stages');
FeatureHelper.describeFeature(module, {
testCategory: 'payment',
testFeature: 'non-free-opportunities',
testFeatureImplemented: true,
testIdentifier: 'opportunity-paid',
testName: 'Successful booking with payment property',
testDescription: 'A successful end to end booking of a non-free opportunity with the `payment` property included if required.',
testOpportunityCriteria: 'TestOpportunityBookableNonFree',
controlOpportunityCriteria: 'TestOpportunityBookable',
},
(configuration, orderItemCriteriaList, featureIsImplemented, logger, describeFeatureRecord) => {
// ## Initiate Flow Stages
// Note this will automatically determine whether payment is available (e.g. in the case of openBookingPrepayment == 'https://openactive.io/Unavailable)
const { fetchOpportunities, c1, c2, bookRecipe } = FlowStageRecipes.initialiseSimpleC1C2BookFlow(orderItemCriteriaList, logger, describeFeatureRecord);
// ## Set up tests
FlowStageUtils.describeRunAndCheckIsSuccessfulAndValid(fetchOpportunities);
FlowStageUtils.describeRunAndCheckIsSuccessfulAndValid(c1);
FlowStageUtils.describeRunAndCheckIsSuccessfulAndValid(c2);
FlowStageUtils.describeRunAndCheckIsSuccessfulAndValid(bookRecipe);
});