pass nextUrl through yubikey flow

the next url comes from sign in via a query param, and needs to go to
the POST /webauthn/authenticate endpoint. That endpoint logs the user
in and returns the redirect to the browser, and will take the next from
the request query params to get there.

also moving the window mocks to beforeEach/afterEach ensures that
promise callbacks from previous tests aren't still associated in future
tests to ensure good test isolation.

unfortunately i couldn't get mocking location for a single js test to
work, but by changing the global config i was able to add some query
params that i can expect to be passed through. Don't love this at all
but not quite sure of a good way round this. I think we're not
practicing very good hygiene and best practices with our mocking and
it's really confounding me here.
This commit is contained in:
Leo Hemsted
2021-05-27 12:07:11 +01:00
parent 5ea82b0cdc
commit bb7343d846
4 changed files with 95 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
module.exports = {
setupFiles: ['./support/setup.js'],
testURL: 'https://www.notifications.service.gov.uk'
testURL: 'https://www.notifications.service.gov.uk/?next=%2Ffoo%3Fbar%3Dbaz'
}