diff options
Diffstat (limited to 'spec/frontend/authentication/u2f')
-rw-r--r-- | spec/frontend/authentication/u2f/authenticate_spec.js | 7 | ||||
-rw-r--r-- | spec/frontend/authentication/u2f/register_spec.js | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/spec/frontend/authentication/u2f/authenticate_spec.js b/spec/frontend/authentication/u2f/authenticate_spec.js index 31782899ce4..3ae7fcf1c49 100644 --- a/spec/frontend/authentication/u2f/authenticate_spec.js +++ b/spec/frontend/authentication/u2f/authenticate_spec.js @@ -1,4 +1,5 @@ import $ from 'jquery'; +import { loadHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import U2FAuthenticate from '~/authentication/u2f/authenticate'; import 'vendor/u2f'; import MockU2FDevice from './mock_u2f_device'; @@ -9,7 +10,7 @@ describe('U2FAuthenticate', () => { let component; beforeEach(() => { - loadFixtures('u2f/authenticate.html'); + loadHTMLFixture('u2f/authenticate.html'); u2fDevice = new MockU2FDevice(); container = $('#js-authenticate-token-2fa'); component = new U2FAuthenticate( @@ -23,6 +24,10 @@ describe('U2FAuthenticate', () => { ); }); + afterEach(() => { + resetHTMLFixture(); + }); + describe('with u2f unavailable', () => { let oldu2f; diff --git a/spec/frontend/authentication/u2f/register_spec.js b/spec/frontend/authentication/u2f/register_spec.js index 810396aa9fd..7ae3a2734cb 100644 --- a/spec/frontend/authentication/u2f/register_spec.js +++ b/spec/frontend/authentication/u2f/register_spec.js @@ -1,4 +1,5 @@ import $ from 'jquery'; +import { loadHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import U2FRegister from '~/authentication/u2f/register'; import 'vendor/u2f'; import MockU2FDevice from './mock_u2f_device'; @@ -9,13 +10,17 @@ describe('U2FRegister', () => { let component; beforeEach(() => { - loadFixtures('u2f/register.html'); + loadHTMLFixture('u2f/register.html'); u2fDevice = new MockU2FDevice(); container = $('#js-register-token-2fa'); component = new U2FRegister(container, {}); return component.start(); }); + afterEach(() => { + resetHTMLFixture(); + }); + it('allows registering a U2F device', () => { const setupButton = container.find('#js-setup-token-2fa-device'); |