-
Notifications
You must be signed in to change notification settings - Fork 3
CCM-17208: Digital Letter - Supplier API Pact tests #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
simonlabarere
wants to merge
5
commits into
main
Choose a base branch
from
feature/CCM-17208_Supplier_api_pact_tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cebf9e4
CCM-17208: Digital Letter - Supplier API Pact tests
simonlabarere a47eb1d
CCM-17208: Digital Letter - Supplier API Pact tests
simonlabarere 78a6b21
Merge branch 'main' into feature/CCM-17208_Supplier_api_pact_tests
simonlabarere c378215
CCM-17208: Fix linting issues
simonlabarere 1f92ab9
CCM-17208: Fix spelling mistake
simonlabarere File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
44 changes: 44 additions & 0 deletions
44
tests/pact-tests/provider/supplier-api.digital-letters.provider.pact.test.ts
This file contains hidden or 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,44 @@ | ||
| import path from 'node:path'; | ||
| import { MessageProviderPact } from '@pact-foundation/pact'; | ||
| import LetterAcceptedEvent from '@nhsdigital/nhs-notify-event-schemas-supplier-api/schemas/examples/letter.ACCEPTED.json'; | ||
| import LetterCancelledEvent from '@nhsdigital/nhs-notify-event-schemas-supplier-api/schemas/examples/letter.CANCELLED.json'; | ||
| import LetterDeliveredEvent from '@nhsdigital/nhs-notify-event-schemas-supplier-api/schemas/examples/letter.DELIVERED.json'; | ||
| import LetterDispatchedEvent from '@nhsdigital/nhs-notify-event-schemas-supplier-api/schemas/examples/letter.DISPATCHED.json'; | ||
| import LetterEnclosedEvent from '@nhsdigital/nhs-notify-event-schemas-supplier-api/schemas/examples/letter.ENCLOSED.json'; | ||
| import LetterFailedEvent from '@nhsdigital/nhs-notify-event-schemas-supplier-api/schemas/examples/letter.FAILED.json'; | ||
| import LetterForwardedEvent from '@nhsdigital/nhs-notify-event-schemas-supplier-api/schemas/examples/letter.FORWARDED.json'; | ||
| import LetterPendingEvent from '@nhsdigital/nhs-notify-event-schemas-supplier-api/schemas/examples/letter.PENDING.json'; | ||
| import LetterPrintedEvent from '@nhsdigital/nhs-notify-event-schemas-supplier-api/schemas/examples/letter.PRINTED.json'; | ||
| import LetterRejectedEvent from '@nhsdigital/nhs-notify-event-schemas-supplier-api/schemas/examples/letter.REJECTED.json'; | ||
| import LetterReturnedEvent from '@nhsdigital/nhs-notify-event-schemas-supplier-api/schemas/examples/letter.RETURNED.json'; | ||
|
|
||
| describe('Supplier API -> Digital Letters pact tests', () => { | ||
| test('verify pacts', async () => { | ||
| const p = new MessageProviderPact({ | ||
| provider: 'ssupplier-api', | ||
| pactUrls: [ | ||
| path.join( | ||
| __dirname, | ||
| '../../../node_modules', | ||
| '@nhsdigital/notify-digital-letters-consumer-contracts/pacts/supplier-api/digital-letters-supplier-api.json' | ||
| ), | ||
| ], | ||
| messageProviders: { | ||
| 'SupplierApiEvent-letter_accepted': () => LetterAcceptedEvent, | ||
| 'SupplierApiEvent-letter_cancelled': () => LetterCancelledEvent, | ||
| 'SupplierApiEvent-letter_delivered': () => LetterDeliveredEvent, | ||
| 'SupplierApiEvent-letter_dispatched': () => LetterDispatchedEvent, | ||
| 'SupplierApiEvent-letter_enclosed': () => LetterEnclosedEvent, | ||
| 'SupplierApiEvent-letter_failed': () => LetterFailedEvent, | ||
| 'SupplierApiEvent-letter_forwarded': () => LetterForwardedEvent, | ||
| 'SupplierApiEvent-letter_pending': () => LetterPendingEvent, | ||
| 'SupplierApiEvent-letter_printed': () => LetterPrintedEvent, | ||
| 'SupplierApiEvent-letter_rejected': () => LetterRejectedEvent, | ||
| 'SupplierApiEvent-letter_returned': () => LetterReturnedEvent, | ||
| }, | ||
| logLevel: 'error', | ||
| }); | ||
|
|
||
| await expect(p.verify()).resolves.not.toThrow(); | ||
| }, 60_000); | ||
| }); | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.