-
Notifications
You must be signed in to change notification settings - Fork 9
/
opportunity-paid-no-payment-error-test.js
23 lines (20 loc) · 1.28 KB
/
opportunity-paid-no-payment-error-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
const { FeatureHelper } = require('../../../../helpers/feature-helper');
const { multipleOpportunityCriteriaTemplateWhichOnlyIncludesOneCriteria, errorTests } = require('../../common');
const { IMPLEMENTED_FEATURES } = global;
const testOpportunityCriteria = 'TestOpportunityBookableNonFreePrepaymentRequired';
const expectedPrepayment = (IMPLEMENTED_FEATURES['prepayment-optional'] || IMPLEMENTED_FEATURES['prepayment-unavailable']) ? 'https://openactive.io/Required' : null;
const expectedError = 'MissingPaymentDetailsError';
const bReqTemplateRef = 'noPayment';
FeatureHelper.describeFeature(module, {
testCategory: 'payment',
testFeature: 'prepayment-required',
testFeatureImplemented: true,
testIdentifier: 'opportunity-paid-no-payment-error',
testName: 'Unsuccessful booking without payment property',
testDescription: 'An unsuccessful end to end booking for a non-free opportunity, failing due to missing `payment` property.',
testOpportunityCriteria,
controlOpportunityCriteria: 'TestOpportunityBookable',
// temporarily disable control in multiple mode until refactoring complete
multipleOpportunityCriteriaTemplate: multipleOpportunityCriteriaTemplateWhichOnlyIncludesOneCriteria(testOpportunityCriteria),
},
errorTests(expectedPrepayment, expectedError, bReqTemplateRef));