diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/frontend/gpg_badges_spec.js | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/frontend/gpg_badges_spec.js')
-rw-r--r-- | spec/frontend/gpg_badges_spec.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/frontend/gpg_badges_spec.js b/spec/frontend/gpg_badges_spec.js index 0bb50fc3e6f..0a1596b492d 100644 --- a/spec/frontend/gpg_badges_spec.js +++ b/spec/frontend/gpg_badges_spec.js @@ -1,4 +1,5 @@ import MockAdapter from 'axios-mock-adapter'; +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { TEST_HOST } from 'spec/test_constants'; import GpgBadges from '~/gpg_badges'; import axios from '~/lib/utils/axios_utils'; @@ -18,7 +19,7 @@ describe('GpgBadges', () => { const dummyUrl = `${TEST_HOST}/dummy/signatures`; const setForm = ({ utf8 = '✓', search = '' } = {}) => { - setFixtures(` + setHTMLFixture(` <form class="commits-search-form js-signature-container" data-signatures-path="${dummyUrl}" action="${dummyUrl}" method="get"> @@ -38,24 +39,27 @@ describe('GpgBadges', () => { afterEach(() => { mock.restore(); + resetHTMLFixture(); }); it('does not make a request if there is no container element', async () => { - setFixtures(''); + setHTMLFixture(''); jest.spyOn(axios, 'get').mockImplementation(() => {}); await GpgBadges.fetch(); expect(axios.get).not.toHaveBeenCalled(); + resetHTMLFixture(); }); it('throws an error if the endpoint is missing', async () => { - setFixtures('<div class="js-signature-container"></div>'); + setHTMLFixture('<div class="js-signature-container"></div>'); jest.spyOn(axios, 'get').mockImplementation(() => {}); await expect(GpgBadges.fetch()).rejects.toEqual( new Error('Missing commit signatures endpoint!'), ); expect(axios.get).not.toHaveBeenCalled(); + resetHTMLFixture(); }); it('fetches commit signatures', async () => { |