Commit 42fe539c authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'xanf-remove-localVue-121743' into 'master'

Remove incorrect localVue usage in spec/frontend/notes

Closes #121743

See merge request gitlab-org/gitlab!22579
parents f70542e8 069d9156
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import diffDiscussionHeader from '~/notes/components/diff_discussion_header.vue'; import diffDiscussionHeader from '~/notes/components/diff_discussion_header.vue';
...@@ -18,11 +18,9 @@ describe('diff_discussion_header component', () => { ...@@ -18,11 +18,9 @@ describe('diff_discussion_header component', () => {
window.mrTabs = {}; window.mrTabs = {};
store = createStore(); store = createStore();
const localVue = createLocalVue();
wrapper = mount(diffDiscussionHeader, { wrapper = mount(diffDiscussionHeader, {
store, store,
propsData: { discussion: discussionMock }, propsData: { discussion: discussionMock },
localVue,
sync: false, sync: false,
}); });
}); });
......
import { shallowMount, mount, createLocalVue } from '@vue/test-utils'; import { shallowMount, mount } from '@vue/test-utils';
import { discussionMock } from '../../notes/mock_data'; import { discussionMock } from '../../notes/mock_data';
import DiscussionActions from '~/notes/components/discussion_actions.vue'; import DiscussionActions from '~/notes/components/discussion_actions.vue';
import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue'; import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue';
...@@ -22,12 +22,10 @@ const createUnallowedNote = () => ...@@ -22,12 +22,10 @@ const createUnallowedNote = () =>
describe('DiscussionActions', () => { describe('DiscussionActions', () => {
let wrapper; let wrapper;
const createComponentFactory = (shallow = true) => props => { const createComponentFactory = (shallow = true) => props => {
const localVue = createLocalVue();
const store = createStore(); const store = createStore();
const mountFn = shallow ? shallowMount : mount; const mountFn = shallow ? shallowMount : mount;
wrapper = mountFn(DiscussionActions, { wrapper = mountFn(DiscussionActions, {
localVue,
store, store,
propsData: { propsData: {
discussion: discussionMock, discussion: discussionMock,
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import '~/behaviors/markdown/render_gfm'; import '~/behaviors/markdown/render_gfm';
import { SYSTEM_NOTE } from '~/notes/constants'; import { SYSTEM_NOTE } from '~/notes/constants';
import DiscussionNotes from '~/notes/components/discussion_notes.vue'; import DiscussionNotes from '~/notes/components/discussion_notes.vue';
...@@ -9,8 +9,6 @@ import SystemNote from '~/vue_shared/components/notes/system_note.vue'; ...@@ -9,8 +9,6 @@ import SystemNote from '~/vue_shared/components/notes/system_note.vue';
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import { noteableDataMock, discussionMock, notesDataMock } from '../../notes/mock_data'; import { noteableDataMock, discussionMock, notesDataMock } from '../../notes/mock_data';
const localVue = createLocalVue();
describe('DiscussionNotes', () => { describe('DiscussionNotes', () => {
let wrapper; let wrapper;
...@@ -20,7 +18,6 @@ describe('DiscussionNotes', () => { ...@@ -20,7 +18,6 @@ describe('DiscussionNotes', () => {
store.dispatch('setNotesData', notesDataMock); store.dispatch('setNotesData', notesDataMock);
wrapper = shallowMount(DiscussionNotes, { wrapper = shallowMount(DiscussionNotes, {
localVue,
store, store,
propsData: { propsData: {
discussion: discussionMock, discussion: discussionMock,
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue'; import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue';
const localVue = createLocalVue();
const buttonText = 'Test Button Text'; const buttonText = 'Test Button Text';
describe('ReplyPlaceholder', () => { describe('ReplyPlaceholder', () => {
...@@ -11,7 +10,6 @@ describe('ReplyPlaceholder', () => { ...@@ -11,7 +10,6 @@ describe('ReplyPlaceholder', () => {
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(ReplyPlaceholder, { wrapper = shallowMount(ReplyPlaceholder, {
localVue,
propsData: { propsData: {
buttonText, buttonText,
}, },
......
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import resolveDiscussionButton from '~/notes/components/discussion_resolve_button.vue'; import resolveDiscussionButton from '~/notes/components/discussion_resolve_button.vue';
const buttonTitle = 'Resolve discussion'; const buttonTitle = 'Resolve discussion';
describe('resolveDiscussionButton', () => { describe('resolveDiscussionButton', () => {
let wrapper; let wrapper;
let localVue;
const factory = options => { const factory = options => {
localVue = createLocalVue();
wrapper = shallowMount(resolveDiscussionButton, { wrapper = shallowMount(resolveDiscussionButton, {
localVue,
...options, ...options,
}); });
}; };
...@@ -69,7 +66,7 @@ describe('resolveDiscussionButton', () => { ...@@ -69,7 +66,7 @@ describe('resolveDiscussionButton', () => {
const button = wrapper.find({ ref: 'isResolvingIcon' }); const button = wrapper.find({ ref: 'isResolvingIcon' });
localVue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(button.exists()).toEqual(false); expect(button.exists()).toEqual(false);
}); });
}); });
......
import $ from 'helpers/jquery'; import $ from 'helpers/jquery';
import AxiosMockAdapter from 'axios-mock-adapter'; import AxiosMockAdapter from 'axios-mock-adapter';
import Vue from 'vue'; import Vue from 'vue';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { setTestTimeout } from 'helpers/timeout'; import { setTestTimeout } from 'helpers/timeout';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import NotesApp from '~/notes/components/notes_app.vue'; import NotesApp from '~/notes/components/notes_app.vue';
...@@ -48,7 +48,6 @@ describe('note_app', () => { ...@@ -48,7 +48,6 @@ describe('note_app', () => {
notesData: mockData.notesDataMock, notesData: mockData.notesDataMock,
userData: mockData.userDataMock, userData: mockData.userDataMock,
}; };
const localVue = createLocalVue();
return mount( return mount(
{ {
...@@ -63,7 +62,6 @@ describe('note_app', () => { ...@@ -63,7 +62,6 @@ describe('note_app', () => {
attachToDocument: true, attachToDocument: true,
propsData, propsData,
store, store,
localVue,
sync: false, sync: false,
}, },
); );
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import NoteEditedText from '~/notes/components/note_edited_text.vue'; import NoteEditedText from '~/notes/components/note_edited_text.vue';
const localVue = createLocalVue();
const propsData = { const propsData = {
actionText: 'Edited', actionText: 'Edited',
className: 'foo-bar', className: 'foo-bar',
...@@ -21,7 +20,6 @@ describe('NoteEditedText', () => { ...@@ -21,7 +20,6 @@ describe('NoteEditedText', () => {
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(NoteEditedText, { wrapper = shallowMount(NoteEditedText, {
localVue,
propsData, propsData,
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
......
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