diff --git a/tests/javascripts/authenticateSecurityKey.test.js b/tests/javascripts/authenticateSecurityKey.test.js index 8c2f11cf5..2b9503331 100644 --- a/tests/javascripts/authenticateSecurityKey.test.js +++ b/tests/javascripts/authenticateSecurityKey.test.js @@ -86,7 +86,7 @@ describe('Authenticate with security key', () => { jest.spyOn(window.location, 'assign').mockImplementation((href) => { expect(href).toEqual("/foo") - done(); + done() }) // this will make the test fail if the alert is called @@ -95,11 +95,11 @@ describe('Authenticate with security key', () => { }) button.click() - }); + }) 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'); + window.history.pushState({}, 'Test Title', '/?next=%2Ffoo%3Fbar%3Dbaz') jest.spyOn(window, 'fetch') .mockImplementationOnce((_url) => { @@ -131,13 +131,13 @@ describe('Authenticate with security key', () => { // subsequent POST of credential data to server expect(url.toString()).toEqual( 'https://www.notifications.service.gov.uk/webauthn/authenticate?next=%2Ffoo%3Fbar%3Dbaz' - ); + ) - done(); + done() }) button.click() - }); + }) test.each([ ['network'], @@ -179,7 +179,7 @@ describe('Authenticate with security key', () => { }) button.click() - }); + }) test.each([ ['network error'], @@ -226,7 +226,7 @@ describe('Authenticate with security key', () => { }) button.click() - }); + }) test('reloads page if POSTing WebAuthn credentials returns 403', (done) => { @@ -263,7 +263,7 @@ describe('Authenticate with security key', () => { // assert that reload is called and the page is refreshed jest.spyOn(window.location, 'reload').mockImplementation(() => { - done(); + done() }) // this will make the test fail if the alert is called @@ -272,7 +272,7 @@ describe('Authenticate with security key', () => { }) button.click() - }); + }) -}); +}) diff --git a/tests/javascripts/registerSecurityKey.test.js b/tests/javascripts/registerSecurityKey.test.js index 043a84224..1886935fd 100644 --- a/tests/javascripts/registerSecurityKey.test.js +++ b/tests/javascripts/registerSecurityKey.test.js @@ -49,7 +49,7 @@ describe('Register security key', () => { return Promise.resolve({ ok: true, arrayBuffer: () => webauthnOptions }) - }); + }) jest.spyOn(window.navigator.credentials, 'create').mockImplementation((options) => { expect(options).toEqual('options') @@ -71,7 +71,7 @@ describe('Register security key', () => { expect(decodedData.attestationObject).toEqual(new Uint8Array([1,2,3])) expect(options.headers['X-CSRFToken']).toBe() return Promise.resolve({ ok: true }) - }); + }) jest.spyOn(window.location, 'reload').mockImplementation(() => { // signal that the async promise chain was called