diff options
Diffstat (limited to 'spec/frontend/badges/components')
4 files changed, 15 insertions, 4 deletions
diff --git a/spec/frontend/badges/components/badge_form_spec.js b/spec/frontend/badges/components/badge_form_spec.js index ba2ec775b61..6d8a00eb50b 100644 --- a/spec/frontend/badges/components/badge_form_spec.js +++ b/spec/frontend/badges/components/badge_form_spec.js @@ -1,5 +1,6 @@ import MockAdapter from 'axios-mock-adapter'; import Vue, { nextTick } from 'vue'; +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { DUMMY_IMAGE_URL, TEST_HOST } from 'helpers/test_constants'; import { mountComponentWithStore } from 'helpers/vue_mount_component_helper'; import BadgeForm from '~/badges/components/badge_form.vue'; @@ -16,7 +17,7 @@ describe('BadgeForm component', () => { let vm; beforeEach(() => { - setFixtures(` + setHTMLFixture(` <div id="dummy-element"></div> `); @@ -26,6 +27,7 @@ describe('BadgeForm component', () => { afterEach(() => { vm.$destroy(); axiosMock.restore(); + resetHTMLFixture(); }); describe('methods', () => { diff --git a/spec/frontend/badges/components/badge_list_row_spec.js b/spec/frontend/badges/components/badge_list_row_spec.js index 0fb0fa86a02..ad8426f3168 100644 --- a/spec/frontend/badges/components/badge_list_row_spec.js +++ b/spec/frontend/badges/components/badge_list_row_spec.js @@ -1,4 +1,5 @@ import Vue, { nextTick } from 'vue'; +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { mountComponentWithStore } from 'helpers/vue_mount_component_helper'; import BadgeListRow from '~/badges/components/badge_list_row.vue'; import { GROUP_BADGE, PROJECT_BADGE } from '~/badges/constants'; @@ -11,7 +12,7 @@ describe('BadgeListRow component', () => { let vm; beforeEach(() => { - setFixtures(` + setHTMLFixture(` <div id="delete-badge-modal" class="modal"></div> <div id="dummy-element"></div> `); @@ -29,6 +30,7 @@ describe('BadgeListRow component', () => { afterEach(() => { vm.$destroy(); + resetHTMLFixture(); }); it('renders the badge', () => { diff --git a/spec/frontend/badges/components/badge_list_spec.js b/spec/frontend/badges/components/badge_list_spec.js index 39fa502b207..32cd9483ef8 100644 --- a/spec/frontend/badges/components/badge_list_spec.js +++ b/spec/frontend/badges/components/badge_list_spec.js @@ -1,4 +1,5 @@ import Vue, { nextTick } from 'vue'; +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { mountComponentWithStore } from 'helpers/vue_mount_component_helper'; import BadgeList from '~/badges/components/badge_list.vue'; import { GROUP_BADGE, PROJECT_BADGE } from '~/badges/constants'; @@ -11,7 +12,7 @@ describe('BadgeList component', () => { let vm; beforeEach(() => { - setFixtures('<div id="dummy-element"></div>'); + setHTMLFixture('<div id="dummy-element"></div>'); const badges = []; for (let id = 0; id < numberOfDummyBadges; id += 1) { badges.push({ id, ...createDummyBadge() }); @@ -34,6 +35,7 @@ describe('BadgeList component', () => { afterEach(() => { vm.$destroy(); + resetHTMLFixture(); }); it('renders a header with the badge count', () => { diff --git a/spec/frontend/badges/components/badge_spec.js b/spec/frontend/badges/components/badge_spec.js index fe4cf8ce8eb..19b3a9f23a6 100644 --- a/spec/frontend/badges/components/badge_spec.js +++ b/spec/frontend/badges/components/badge_spec.js @@ -1,4 +1,5 @@ import Vue, { nextTick } from 'vue'; +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import mountComponent from 'helpers/vue_mount_component_helper'; import { DUMMY_IMAGE_URL, TEST_HOST } from 'spec/test_constants'; import Badge from '~/badges/components/badge.vue'; @@ -90,10 +91,14 @@ describe('Badge component', () => { describe('behavior', () => { beforeEach(() => { - setFixtures('<div id="dummy-element"></div>'); + setHTMLFixture('<div id="dummy-element"></div>'); return createComponent({ ...dummyProps }, '#dummy-element'); }); + afterEach(() => { + resetHTMLFixture(); + }); + it('shows a badge image after loading', () => { expect(vm.isLoading).toBe(false); expect(vm.hasError).toBe(false); |