diff options
Diffstat (limited to 'spec/frontend/vue_shared')
4 files changed, 19 insertions, 26 deletions
diff --git a/spec/frontend/vue_shared/components/gl_modal_vuex_spec.js b/spec/frontend/vue_shared/components/gl_modal_vuex_spec.js index 4b7636041b6..8437e68d73c 100644 --- a/spec/frontend/vue_shared/components/gl_modal_vuex_spec.js +++ b/spec/frontend/vue_shared/components/gl_modal_vuex_spec.js @@ -33,7 +33,7 @@ describe('GlModalVuex', () => { ...options.propsData, }; - wrapper = shallowMount(localVue.extend(GlModalVuex), { + wrapper = shallowMount(GlModalVuex, { ...options, localVue, store, @@ -123,8 +123,8 @@ describe('GlModalVuex', () => { state.isVisible = true; - localVue - .nextTick() + wrapper.vm + .$nextTick() .then(() => { expect(rootEmit).toHaveBeenCalledWith('bv::show::modal', TEST_MODAL_ID); }) @@ -140,8 +140,8 @@ describe('GlModalVuex', () => { state.isVisible = false; - localVue - .nextTick() + wrapper.vm + .$nextTick() .then(() => { expect(rootEmit).toHaveBeenCalledWith('bv::hide::modal', TEST_MODAL_ID); }) diff --git a/spec/frontend/vue_shared/components/markdown/field_spec.js b/spec/frontend/vue_shared/components/markdown/field_spec.js index 2569f2f02a7..7a05bf092f5 100644 --- a/spec/frontend/vue_shared/components/markdown/field_spec.js +++ b/spec/frontend/vue_shared/components/markdown/field_spec.js @@ -1,4 +1,4 @@ -import { mount, createLocalVue } from '@vue/test-utils'; +import { mount } from '@vue/test-utils'; import fieldComponent from '~/vue_shared/components/markdown/field.vue'; import { TEST_HOST, FIXTURES_PATH } from 'spec/test_constants'; import AxiosMockAdapter from 'axios-mock-adapter'; @@ -50,7 +50,6 @@ const getVideo = wrapper => wrapper.find('video'); describe('Markdown field component', () => { let axiosMock; - const localVue = createLocalVue(); beforeEach(() => { axiosMock = new AxiosMockAdapter(axios); @@ -84,7 +83,7 @@ describe('Markdown field component', () => { previewLink = getPreviewLink(wrapper); previewLink.trigger('click'); - return localVue.nextTick().then(() => { + return wrapper.vm.$nextTick().then(() => { expect(previewLink.element.parentNode.classList.contains('active')).toBeTruthy(); }); }); @@ -94,7 +93,7 @@ describe('Markdown field component', () => { previewLink = getPreviewLink(wrapper); previewLink.trigger('click'); - localVue.nextTick(() => { + wrapper.vm.$nextTick(() => { expect(wrapper.find('.md-preview-holder').element.textContent.trim()).toContain( 'Loading…', ); @@ -155,17 +154,17 @@ describe('Markdown field component', () => { previewLink = getPreviewLink(wrapper); writeLink.trigger('click'); - return localVue - .nextTick() + return wrapper.vm + .$nextTick() .then(() => assertMarkdownTabs(true, writeLink, previewLink, wrapper)) .then(() => writeLink.trigger('click')) - .then(() => localVue.nextTick()) + .then(() => wrapper.vm.$nextTick()) .then(() => assertMarkdownTabs(true, writeLink, previewLink, wrapper)) .then(() => previewLink.trigger('click')) - .then(() => localVue.nextTick()) + .then(() => wrapper.vm.$nextTick()) .then(() => assertMarkdownTabs(false, writeLink, previewLink, wrapper)) .then(() => previewLink.trigger('click')) - .then(() => localVue.nextTick()) + .then(() => wrapper.vm.$nextTick()) .then(() => assertMarkdownTabs(false, writeLink, previewLink, wrapper)); }); }); @@ -178,7 +177,7 @@ describe('Markdown field component', () => { const markdownButton = getMarkdownButton(wrapper); markdownButton.trigger('click'); - localVue.nextTick(() => { + wrapper.vm.$nextTick(() => { expect(textarea.value).toContain('**testing**'); }); }); @@ -190,7 +189,7 @@ describe('Markdown field component', () => { const markdownButton = getAllMarkdownButtons(wrapper).wrappers[5]; markdownButton.trigger('click'); - localVue.nextTick(() => { + wrapper.vm.$nextTick(() => { expect(textarea.value).toContain('* testing'); }); }); @@ -202,7 +201,7 @@ describe('Markdown field component', () => { const markdownButton = getAllMarkdownButtons(wrapper).wrappers[5]; markdownButton.trigger('click'); - localVue.nextTick(() => { + wrapper.vm.$nextTick(() => { expect(textarea.value).toContain('* testing\n* 123'); }); }); diff --git a/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js b/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js index 8e6ac6a5fab..97fcdc67791 100644 --- a/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js +++ b/spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js @@ -1,4 +1,4 @@ -import { shallowMount, createLocalVue } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import SuggestionDiffRow from '~/vue_shared/components/markdown/suggestion_diff_row.vue'; const oldLine = { @@ -27,10 +27,7 @@ describe('SuggestionDiffRow', () => { let wrapper; const factory = (options = {}) => { - const localVue = createLocalVue(); - wrapper = shallowMount(SuggestionDiffRow, { - localVue, ...options, }); }; diff --git a/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js b/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js index 491e672b0e4..6f66d1cafb9 100644 --- a/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js +++ b/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js @@ -1,4 +1,4 @@ -import { shallowMount, createLocalVue } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import { GlButton } from '@gitlab/ui'; import { TEST_HOST } from 'spec/test_constants'; import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue'; @@ -20,8 +20,6 @@ const createList = n => .fill(1) .map((x, id) => createUser(id)); -const localVue = createLocalVue(); - describe('UserAvatarList', () => { let props; let wrapper; @@ -32,9 +30,8 @@ describe('UserAvatarList', () => { ...options.propsData, }; - wrapper = shallowMount(localVue.extend(UserAvatarList), { + wrapper = shallowMount(UserAvatarList, { ...options, - localVue, propsData, }); }; |