Files
notifications-admin/tests/javascripts/registerSecurityKey.test.js
Ben Thorner ebb82b2e80 Add page for security keys with stubbed data
This adds a new platform admin settings row, leading a page which
shows any existing keys and allows a new one to be registered. Until
the APIs for this are implemented, the user API client just returns
some stubbed data for manual testing.

This also includes a basic JavaScript module to do the main work of
registering a new authenticator, to be implemented in the next commits.

Some more minor notes:

- Setting the headings in the mapping_table is necessary to get the
horizontal rule along the top (to match the design).

- Setting caption to False in the mapping_table is necessary to stop
an extra margin appearing at the top.
2021-05-12 13:41:53 +01:00

27 lines
721 B
JavaScript

beforeAll(() => {
require('../../app/assets/javascripts/registerSecurityKey.js');
})
afterAll(() => {
require('./support/teardown.js');
})
describe('Register security key', () => {
beforeEach(() => {
document.body.innerHTML = `
<a href="#" role="button" draggable="false" class="govuk-button govuk-button--secondary" data-module="register-security-key">
Register a key
</a>`;
})
test('it is not implemented yet', () => {
window.GOVUK.modules.start();
jest.spyOn(window, 'alert').mockImplementation(() => {});
button = document.querySelector('[data-module="register-security-key"]');
button.click();
expect(window.alert).toBeCalledWith('not implemented')
})
})