-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpayment-mismatch-test.js
23 lines (20 loc) · 1.42 KB
/
payment-mismatch-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 = 'TotalPaymentDueMismatchError';
const bReqTemplateRef = 'incorrectTotalPaymentDuePrice';
FeatureHelper.describeFeature(module, {
testCategory: 'payment',
testFeature: 'prepayment-required',
testFeatureImplemented: true,
testIdentifier: 'payment-mismatch',
testName: 'Expect a TotalPaymentDueMismatchError when the totalPaymentDue property does not match',
testDescription: 'Run B for a valid opportunity, with totalPaymentDue not matching the value returned by C2, expecting a TotalPaymentDueMismatchError to be returned (C1 and C2 ignored as they do not have totalPaymentDue)',
testOpportunityCriteria,
controlOpportunityCriteria: 'TestOpportunityBookable',
// temporarily disable control in multiple mode until refactoring complete
multipleOpportunityCriteriaTemplate: multipleOpportunityCriteriaTemplateWhichOnlyIncludesOneCriteria(testOpportunityCriteria),
},
errorTests(expectedPrepayment, expectedError, bReqTemplateRef));