Remove redundant semicolons in ES6 tests

This commit is contained in:
Ben Thorner
2021-06-10 14:48:18 +01:00
parent 1bb49e5456
commit a2fb92ab74
2 changed files with 13 additions and 13 deletions
@@ -86,7 +86,7 @@ describe('Authenticate with security key', () => {
jest.spyOn(window.location, 'assign').mockImplementation((href) => { jest.spyOn(window.location, 'assign').mockImplementation((href) => {
expect(href).toEqual("/foo") expect(href).toEqual("/foo")
done(); done()
}) })
// this will make the test fail if the alert is called // this will make the test fail if the alert is called
@@ -95,11 +95,11 @@ describe('Authenticate with security key', () => {
}) })
button.click() button.click()
}); })
test('authenticates and passes a redirect url through to the authenticate admin endpoint', (done) => { test('authenticates and passes a redirect url through to the authenticate admin endpoint', (done) => {
// https://github.com/facebook/jest/issues/890#issuecomment-415202799 // 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') jest.spyOn(window, 'fetch')
.mockImplementationOnce((_url) => { .mockImplementationOnce((_url) => {
@@ -131,13 +131,13 @@ describe('Authenticate with security key', () => {
// subsequent POST of credential data to server // subsequent POST of credential data to server
expect(url.toString()).toEqual( expect(url.toString()).toEqual(
'https://www.notifications.service.gov.uk/webauthn/authenticate?next=%2Ffoo%3Fbar%3Dbaz' 'https://www.notifications.service.gov.uk/webauthn/authenticate?next=%2Ffoo%3Fbar%3Dbaz'
); )
done(); done()
}) })
button.click() button.click()
}); })
test.each([ test.each([
['network'], ['network'],
@@ -179,7 +179,7 @@ describe('Authenticate with security key', () => {
}) })
button.click() button.click()
}); })
test.each([ test.each([
['network error'], ['network error'],
@@ -226,7 +226,7 @@ describe('Authenticate with security key', () => {
}) })
button.click() button.click()
}); })
test('reloads page if POSTing WebAuthn credentials returns 403', (done) => { 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 // assert that reload is called and the page is refreshed
jest.spyOn(window.location, 'reload').mockImplementation(() => { jest.spyOn(window.location, 'reload').mockImplementation(() => {
done(); done()
}) })
// this will make the test fail if the alert is called // this will make the test fail if the alert is called
@@ -272,7 +272,7 @@ describe('Authenticate with security key', () => {
}) })
button.click() button.click()
}); })
}); })
@@ -49,7 +49,7 @@ describe('Register security key', () => {
return Promise.resolve({ return Promise.resolve({
ok: true, arrayBuffer: () => webauthnOptions ok: true, arrayBuffer: () => webauthnOptions
}) })
}); })
jest.spyOn(window.navigator.credentials, 'create').mockImplementation((options) => { jest.spyOn(window.navigator.credentials, 'create').mockImplementation((options) => {
expect(options).toEqual('options') expect(options).toEqual('options')
@@ -71,7 +71,7 @@ describe('Register security key', () => {
expect(decodedData.attestationObject).toEqual(new Uint8Array([1,2,3])) expect(decodedData.attestationObject).toEqual(new Uint8Array([1,2,3]))
expect(options.headers['X-CSRFToken']).toBe() expect(options.headers['X-CSRFToken']).toBe()
return Promise.resolve({ ok: true }) return Promise.resolve({ ok: true })
}); })
jest.spyOn(window.location, 'reload').mockImplementation(() => { jest.spyOn(window.location, 'reload').mockImplementation(() => {
// signal that the async promise chain was called // signal that the async promise chain was called