This repository has been archived by the owner on Jan 17, 2025. It is now read-only.
Allow assigning our own reference to Notify emails #298
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.
https://mhclgdigital.atlassian.net/browse/FSPT-137
Change description
Our end-to-end test suite is currently taking quite a long time to run, as many of the tests run sequentially. The main reason for needing them to run sequentially is that some tests login as the same user, and the login attempts are in conflict. This conflict is not handled well by the end-to-end tests and concurrent logins are not well supported by authenticator. Authenticator allows multiple login sessions to exist at once, but does not allow multiple unredeemed magic links to exist for one account at the same time. Furthermore, the end-to-end tests use a "list all magic links" endpoint on authenticator and then grab the top magic link off the stack. This link isn't necessarily associated with the account that they are trying to log in as, which is bad.
This patch allows a reference to be associated with an email sent via GOV.UK Notify. When a magic link email is sent, the calling code can set a reference which the e2e tests can then scan for. This will let the e2e tests retrieve the correct magic link from Notify for the account it was trying to log into.