-
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.
- Loading branch information
1 parent
e897411
commit 1198971
Showing
8 changed files
with
68 additions
and
19 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
25 changes: 25 additions & 0 deletions
25
...test/features/payment/free-opportunities/implemented/opportunity-free-idempotency-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,25 @@ | ||
const { FeatureHelper } = require('../../../../helpers/feature-helper'); | ||
const { FlowStageRecipes, FlowStageUtils } = require('../../../../helpers/flow-stages'); | ||
|
||
FeatureHelper.describeFeature(module, { | ||
testCategory: 'payment', | ||
testFeature: 'free-opportunities', | ||
testFeatureImplemented: true, | ||
testIdentifier: 'opportunity-free-idempotency', | ||
testName: 'Successful booking of free opportunity with idempotency', | ||
testDescription: 'Testing idempotency of the B call for free opportunities', | ||
testOpportunityCriteria: 'TestOpportunityBookableFree', | ||
// This must also be TestOpportunityBookableFree as the entire Order must be free. | ||
controlOpportunityCriteria: 'TestOpportunityBookableFree', | ||
}, (configuration, orderItemCriteriaList, featureIsImplemented, logger, opportunityType, bookingFlow) => { | ||
Check failure on line 14 in packages/openactive-integration-tests/test/features/payment/free-opportunities/implemented/opportunity-free-idempotency-test.js GitHub Actions / build
|
||
const { fetchOpportunities, bookRecipe, defaultFlowStageParams, bookRecipeGetFirstStageInput, bookRecipeGetAssertOpportunityCapacityInput } = FlowStageRecipes.initialiseSimpleC1C2BookFlow(orderItemCriteriaList, logger); | ||
const idempotentRepeatB = FlowStageRecipes.idempotentRepeatBAfterBook(orderItemCriteriaList, bookRecipe, defaultFlowStageParams, { | ||
getFirstStageInput: bookRecipeGetFirstStageInput, | ||
getAssertOpportunityCapacityInput: bookRecipeGetAssertOpportunityCapacityInput, | ||
}); | ||
FlowStageUtils.describeRunAndCheckIsSuccessfulAndValid(fetchOpportunities); | ||
FlowStageUtils.describeRunAndCheckIsSuccessfulAndValid(bookRecipe); | ||
describe('idempotent repeat B', () => { | ||
FlowStageUtils.describeRunAndCheckIsSuccessfulAndValid(idempotentRepeatB); | ||
}); | ||
}); |
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
28 changes: 28 additions & 0 deletions
28
.../features/payment/non-free-opportunities/implemented/opportunity-paid-idempotency-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,28 @@ | ||
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-idempotency', | ||
testName: 'Successful booking of paid opportunity with idempotency', | ||
testDescription: 'Testing idempotency of the B call for paid opportunities', | ||
testOpportunityCriteria: 'TestOpportunityBookableNonFree', | ||
controlOpportunityCriteria: 'TestOpportunityBookable', | ||
}, | ||
(configuration, orderItemCriteriaList, featureIsImplemented, logger, opportunityType, bookingFlow) => { | ||
Check failure on line 14 in packages/openactive-integration-tests/test/features/payment/non-free-opportunities/implemented/opportunity-paid-idempotency-test.js GitHub Actions / build
|
||
// Initiate Flow Stages | ||
const { fetchOpportunities, bookRecipe, defaultFlowStageParams, bookRecipeGetFirstStageInput, bookRecipeGetAssertOpportunityCapacityInput } = FlowStageRecipes.initialiseSimpleC1C2BookFlow(orderItemCriteriaList, logger); | ||
const idempotentRepeatB = FlowStageRecipes.idempotentRepeatBAfterBook(orderItemCriteriaList, bookRecipe, defaultFlowStageParams, { | ||
getFirstStageInput: bookRecipeGetFirstStageInput, | ||
getAssertOpportunityCapacityInput: bookRecipeGetAssertOpportunityCapacityInput, | ||
}); | ||
|
||
// Set up tests | ||
FlowStageUtils.describeRunAndCheckIsSuccessfulAndValid(fetchOpportunities); | ||
FlowStageUtils.describeRunAndCheckIsSuccessfulAndValid(bookRecipe); | ||
describe('idempotent repeat B', () => { | ||
FlowStageUtils.describeRunAndCheckIsSuccessfulAndValid(idempotentRepeatB); | ||
}); | ||
}); |
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