diff options
Diffstat (limited to 'spec/frontend/authentication/u2f/authenticate_spec.js')
-rw-r--r-- | spec/frontend/authentication/u2f/authenticate_spec.js | 15 |
1 files changed, 5 insertions, 10 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', () => { |