Commit e161c7ca authored by Illya Klymov's avatar Illya Klymov

Remove incorrect localVue usage

localVue is required only with use method
parent 4372a6c9
...@@ -33,7 +33,7 @@ describe('GlModalVuex', () => { ...@@ -33,7 +33,7 @@ describe('GlModalVuex', () => {
...options.propsData, ...options.propsData,
}; };
wrapper = shallowMount(localVue.extend(GlModalVuex), { wrapper = shallowMount(GlModalVuex, {
...options, ...options,
localVue, localVue,
store, store,
...@@ -123,8 +123,8 @@ describe('GlModalVuex', () => { ...@@ -123,8 +123,8 @@ describe('GlModalVuex', () => {
state.isVisible = true; state.isVisible = true;
localVue wrapper.vm
.nextTick() .$nextTick()
.then(() => { .then(() => {
expect(rootEmit).toHaveBeenCalledWith('bv::show::modal', TEST_MODAL_ID); expect(rootEmit).toHaveBeenCalledWith('bv::show::modal', TEST_MODAL_ID);
}) })
...@@ -140,8 +140,8 @@ describe('GlModalVuex', () => { ...@@ -140,8 +140,8 @@ describe('GlModalVuex', () => {
state.isVisible = false; state.isVisible = false;
localVue wrapper.vm
.nextTick() .$nextTick()
.then(() => { .then(() => {
expect(rootEmit).toHaveBeenCalledWith('bv::hide::modal', TEST_MODAL_ID); expect(rootEmit).toHaveBeenCalledWith('bv::hide::modal', TEST_MODAL_ID);
}) })
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import fieldComponent from '~/vue_shared/components/markdown/field.vue'; import fieldComponent from '~/vue_shared/components/markdown/field.vue';
import { TEST_HOST, FIXTURES_PATH } from 'spec/test_constants'; import { TEST_HOST, FIXTURES_PATH } from 'spec/test_constants';
import AxiosMockAdapter from 'axios-mock-adapter'; import AxiosMockAdapter from 'axios-mock-adapter';
...@@ -50,7 +50,6 @@ const getVideo = wrapper => wrapper.find('video'); ...@@ -50,7 +50,6 @@ const getVideo = wrapper => wrapper.find('video');
describe('Markdown field component', () => { describe('Markdown field component', () => {
let axiosMock; let axiosMock;
const localVue = createLocalVue();
beforeEach(() => { beforeEach(() => {
axiosMock = new AxiosMockAdapter(axios); axiosMock = new AxiosMockAdapter(axios);
...@@ -84,7 +83,7 @@ describe('Markdown field component', () => { ...@@ -84,7 +83,7 @@ describe('Markdown field component', () => {
previewLink = getPreviewLink(wrapper); previewLink = getPreviewLink(wrapper);
previewLink.trigger('click'); previewLink.trigger('click');
return localVue.nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(previewLink.element.parentNode.classList.contains('active')).toBeTruthy(); expect(previewLink.element.parentNode.classList.contains('active')).toBeTruthy();
}); });
}); });
...@@ -94,7 +93,7 @@ describe('Markdown field component', () => { ...@@ -94,7 +93,7 @@ describe('Markdown field component', () => {
previewLink = getPreviewLink(wrapper); previewLink = getPreviewLink(wrapper);
previewLink.trigger('click'); previewLink.trigger('click');
localVue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(wrapper.find('.md-preview-holder').element.textContent.trim()).toContain( expect(wrapper.find('.md-preview-holder').element.textContent.trim()).toContain(
'Loading…', 'Loading…',
); );
...@@ -155,17 +154,17 @@ describe('Markdown field component', () => { ...@@ -155,17 +154,17 @@ describe('Markdown field component', () => {
previewLink = getPreviewLink(wrapper); previewLink = getPreviewLink(wrapper);
writeLink.trigger('click'); writeLink.trigger('click');
return localVue return wrapper.vm
.nextTick() .$nextTick()
.then(() => assertMarkdownTabs(true, writeLink, previewLink, wrapper)) .then(() => assertMarkdownTabs(true, writeLink, previewLink, wrapper))
.then(() => writeLink.trigger('click')) .then(() => writeLink.trigger('click'))
.then(() => localVue.nextTick()) .then(() => wrapper.vm.$nextTick())
.then(() => assertMarkdownTabs(true, writeLink, previewLink, wrapper)) .then(() => assertMarkdownTabs(true, writeLink, previewLink, wrapper))
.then(() => previewLink.trigger('click')) .then(() => previewLink.trigger('click'))
.then(() => localVue.nextTick()) .then(() => wrapper.vm.$nextTick())
.then(() => assertMarkdownTabs(false, writeLink, previewLink, wrapper)) .then(() => assertMarkdownTabs(false, writeLink, previewLink, wrapper))
.then(() => previewLink.trigger('click')) .then(() => previewLink.trigger('click'))
.then(() => localVue.nextTick()) .then(() => wrapper.vm.$nextTick())
.then(() => assertMarkdownTabs(false, writeLink, previewLink, wrapper)); .then(() => assertMarkdownTabs(false, writeLink, previewLink, wrapper));
}); });
}); });
...@@ -178,7 +177,7 @@ describe('Markdown field component', () => { ...@@ -178,7 +177,7 @@ describe('Markdown field component', () => {
const markdownButton = getMarkdownButton(wrapper); const markdownButton = getMarkdownButton(wrapper);
markdownButton.trigger('click'); markdownButton.trigger('click');
localVue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(textarea.value).toContain('**testing**'); expect(textarea.value).toContain('**testing**');
}); });
}); });
...@@ -190,7 +189,7 @@ describe('Markdown field component', () => { ...@@ -190,7 +189,7 @@ describe('Markdown field component', () => {
const markdownButton = getAllMarkdownButtons(wrapper).wrappers[5]; const markdownButton = getAllMarkdownButtons(wrapper).wrappers[5];
markdownButton.trigger('click'); markdownButton.trigger('click');
localVue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(textarea.value).toContain('* testing'); expect(textarea.value).toContain('* testing');
}); });
}); });
...@@ -202,7 +201,7 @@ describe('Markdown field component', () => { ...@@ -202,7 +201,7 @@ describe('Markdown field component', () => {
const markdownButton = getAllMarkdownButtons(wrapper).wrappers[5]; const markdownButton = getAllMarkdownButtons(wrapper).wrappers[5];
markdownButton.trigger('click'); markdownButton.trigger('click');
localVue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(textarea.value).toContain('* testing\n* 123'); expect(textarea.value).toContain('* testing\n* 123');
}); });
}); });
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import SuggestionDiffRow from '~/vue_shared/components/markdown/suggestion_diff_row.vue'; import SuggestionDiffRow from '~/vue_shared/components/markdown/suggestion_diff_row.vue';
const oldLine = { const oldLine = {
...@@ -27,10 +27,7 @@ describe('SuggestionDiffRow', () => { ...@@ -27,10 +27,7 @@ describe('SuggestionDiffRow', () => {
let wrapper; let wrapper;
const factory = (options = {}) => { const factory = (options = {}) => {
const localVue = createLocalVue();
wrapper = shallowMount(SuggestionDiffRow, { wrapper = shallowMount(SuggestionDiffRow, {
localVue,
...options, ...options,
}); });
}; };
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue'; import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue';
...@@ -20,8 +20,6 @@ const createList = n => ...@@ -20,8 +20,6 @@ const createList = n =>
.fill(1) .fill(1)
.map((x, id) => createUser(id)); .map((x, id) => createUser(id));
const localVue = createLocalVue();
describe('UserAvatarList', () => { describe('UserAvatarList', () => {
let props; let props;
let wrapper; let wrapper;
...@@ -32,9 +30,8 @@ describe('UserAvatarList', () => { ...@@ -32,9 +30,8 @@ describe('UserAvatarList', () => {
...options.propsData, ...options.propsData,
}; };
wrapper = shallowMount(localVue.extend(UserAvatarList), { wrapper = shallowMount(UserAvatarList, {
...options, ...options,
localVue,
propsData, propsData,
}); });
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment