diff options
Diffstat (limited to 'spec/frontend/authentication/u2f')
-rw-r--r-- | spec/frontend/authentication/u2f/authenticate_spec.js | 15 | ||||
-rw-r--r-- | spec/frontend/authentication/u2f/register_spec.js | 4 |
2 files changed, 7 insertions, 12 deletions
diff --git a/spec/frontend/authentication/u2f/authenticate_spec.js b/spec/frontend/authentication/u2f/authenticate_spec.js index 153d4be56af..31782899ce4 100644 --- a/spec/frontend/authentication/u2f/authenticate_spec.js +++ b/spec/frontend/authentication/u2f/authenticate_spec.js @@ -36,24 +36,19 @@ describe('U2FAuthenticate', () => { window.u2f = oldu2f; }); - it('falls back to normal 2fa', (done) => { - component - .start() - .then(() => { - expect(component.switchToFallbackUI).toHaveBeenCalled(); - done(); - }) - .catch(done.fail); + it('falls back to normal 2fa', async () => { + await component.start(); + expect(component.switchToFallbackUI).toHaveBeenCalled(); }); }); describe('with u2f available', () => { - beforeEach((done) => { + beforeEach(() => { // bypass automatic form submission within renderAuthenticated jest.spyOn(component, 'renderAuthenticated').mockReturnValue(true); u2fDevice = new MockU2FDevice(); - component.start().then(done).catch(done.fail); + return component.start(); }); it('allows authenticating via a U2F device', () => { diff --git a/spec/frontend/authentication/u2f/register_spec.js b/spec/frontend/authentication/u2f/register_spec.js index a814144ac7a..810396aa9fd 100644 --- a/spec/frontend/authentication/u2f/register_spec.js +++ b/spec/frontend/authentication/u2f/register_spec.js @@ -8,12 +8,12 @@ describe('U2FRegister', () => { let container; let component; - beforeEach((done) => { + beforeEach(() => { loadFixtures('u2f/register.html'); u2fDevice = new MockU2FDevice(); container = $('#js-register-token-2fa'); component = new U2FRegister(container, {}); - component.start().then(done).catch(done.fail); + return component.start(); }); it('allows registering a U2F device', () => { |