mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 19:34:15 -05:00
Update tests to use most recent jest and supporting libraries
This commit is contained in:
@@ -99,9 +99,6 @@ 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
|
||||
@@ -131,11 +128,11 @@ describe('Authenticate with security key', () => {
|
||||
.mockImplementationOnce((url, options = {}) => {
|
||||
// subsequent POST of credential data to server
|
||||
expect(url.toString()).toEqual(
|
||||
'https://www.notifications.service.gov.uk/webauthn/authenticate?next=%2Ffoo%3Fbar%3Dbaz'
|
||||
'https://www.notifications.service.gov.uk/webauthn/authenticate'
|
||||
)
|
||||
return Promise.resolve({
|
||||
ok: true, arrayBuffer: () => Promise.resolve(window.CBOR.encode({ redirect_url: '/foo' }))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
jest.spyOn(window.location, 'assign').mockImplementation((href) => {
|
||||
|
||||
Reference in New Issue
Block a user