Set window location for individual test

This is less surprising and means we don't end up in a situation
where a future test needs to change the global config to something
else.
This commit is contained in:
Ben Thorner
2021-06-08 16:02:55 +01:00
parent 1b459d6692
commit 3a4601bbe4
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