Merge pull request #3922 from alphagov/try-avoid-global-query-params

Set window location for individual test
This commit is contained in:
Ben Thorner
2021-06-09 12:48:21 +01:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -99,6 +99,9 @@ describe('Authenticate with security key', () => {
});
test('authenticates and passes a redirect url through to the authenticate admin endpoint', (done) => {
// https://github.com/facebook/jest/issues/890#issuecomment-415202799
window.history.pushState({}, 'Test Title', '/?next=%2Ffoo%3Fbar%3Dbaz');
jest.spyOn(window, 'fetch')
.mockImplementationOnce((_url) => {
// initial fetch of options from the server

View File

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