Commit f2e76472 authored by Stanislav Lashmanov's avatar Stanislav Lashmanov

Remove localVue usage from non-EE tests without VueApollo

Epic: https://gitlab.com/gitlab-org/gitlab/-/issues/220482
parent 6d0438a4
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import DiscussionCounter from '~/notes/components/discussion_counter.vue'; import DiscussionCounter from '~/notes/components/discussion_counter.vue';
import notesModule from '~/notes/stores/modules'; import notesModule from '~/notes/stores/modules';
...@@ -10,9 +11,8 @@ describe('DiscussionCounter component', () => { ...@@ -10,9 +11,8 @@ describe('DiscussionCounter component', () => {
let store; let store;
let wrapper; let wrapper;
let setExpandDiscussionsFn; let setExpandDiscussionsFn;
const localVue = createLocalVue();
localVue.use(Vuex); Vue.use(Vuex);
beforeEach(() => { beforeEach(() => {
window.mrTabs = {}; window.mrTabs = {};
...@@ -45,7 +45,7 @@ describe('DiscussionCounter component', () => { ...@@ -45,7 +45,7 @@ describe('DiscussionCounter component', () => {
describe('has no discussions', () => { describe('has no discussions', () => {
it('does not render', () => { it('does not render', () => {
wrapper = shallowMount(DiscussionCounter, { store, localVue }); wrapper = shallowMount(DiscussionCounter, { store });
expect(wrapper.find({ ref: 'discussionCounter' }).exists()).toBe(false); expect(wrapper.find({ ref: 'discussionCounter' }).exists()).toBe(false);
}); });
...@@ -55,7 +55,7 @@ describe('DiscussionCounter component', () => { ...@@ -55,7 +55,7 @@ describe('DiscussionCounter component', () => {
it('does not render', () => { it('does not render', () => {
store.commit(types.ADD_OR_UPDATE_DISCUSSIONS, [{ ...discussionMock, resolvable: false }]); store.commit(types.ADD_OR_UPDATE_DISCUSSIONS, [{ ...discussionMock, resolvable: false }]);
store.dispatch('updateResolvableDiscussionsCounts'); store.dispatch('updateResolvableDiscussionsCounts');
wrapper = shallowMount(DiscussionCounter, { store, localVue }); wrapper = shallowMount(DiscussionCounter, { store });
expect(wrapper.find({ ref: 'discussionCounter' }).exists()).toBe(false); expect(wrapper.find({ ref: 'discussionCounter' }).exists()).toBe(false);
}); });
...@@ -75,7 +75,7 @@ describe('DiscussionCounter component', () => { ...@@ -75,7 +75,7 @@ describe('DiscussionCounter component', () => {
it('renders', () => { it('renders', () => {
updateStore(); updateStore();
wrapper = shallowMount(DiscussionCounter, { store, localVue }); wrapper = shallowMount(DiscussionCounter, { store });
expect(wrapper.find({ ref: 'discussionCounter' }).exists()).toBe(true); expect(wrapper.find({ ref: 'discussionCounter' }).exists()).toBe(true);
}); });
...@@ -86,7 +86,7 @@ describe('DiscussionCounter component', () => { ...@@ -86,7 +86,7 @@ describe('DiscussionCounter component', () => {
${'allResolved'} | ${true} | ${true} | ${1} ${'allResolved'} | ${true} | ${true} | ${1}
`('renders correctly if $title', ({ resolved, isActive, groupLength }) => { `('renders correctly if $title', ({ resolved, isActive, groupLength }) => {
updateStore({ resolvable: true, resolved }); updateStore({ resolvable: true, resolved });
wrapper = shallowMount(DiscussionCounter, { store, localVue }); wrapper = shallowMount(DiscussionCounter, { store });
expect(wrapper.find(`.is-active`).exists()).toBe(isActive); expect(wrapper.find(`.is-active`).exists()).toBe(isActive);
expect(wrapper.findAll(GlButton)).toHaveLength(groupLength); expect(wrapper.findAll(GlButton)).toHaveLength(groupLength);
...@@ -99,7 +99,7 @@ describe('DiscussionCounter component', () => { ...@@ -99,7 +99,7 @@ describe('DiscussionCounter component', () => {
const discussion = { ...discussionMock, expanded }; const discussion = { ...discussionMock, expanded };
store.commit(types.ADD_OR_UPDATE_DISCUSSIONS, [discussion]); store.commit(types.ADD_OR_UPDATE_DISCUSSIONS, [discussion]);
store.dispatch('updateResolvableDiscussionsCounts'); store.dispatch('updateResolvableDiscussionsCounts');
wrapper = shallowMount(DiscussionCounter, { store, localVue }); wrapper = shallowMount(DiscussionCounter, { store });
toggleAllButton = wrapper.find('.toggle-all-discussions-btn'); toggleAllButton = wrapper.find('.toggle-all-discussions-btn');
}; };
......
import { GlDropdown } from '@gitlab/ui'; import { GlDropdown } from '@gitlab/ui';
import { createLocalVue, mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue';
import AxiosMockAdapter from 'axios-mock-adapter'; import AxiosMockAdapter from 'axios-mock-adapter';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
...@@ -12,9 +13,7 @@ import notesModule from '~/notes/stores/modules'; ...@@ -12,9 +13,7 @@ import notesModule from '~/notes/stores/modules';
import { discussionFiltersMock, discussionMock } from '../mock_data'; import { discussionFiltersMock, discussionMock } from '../mock_data';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
const DISCUSSION_PATH = `${TEST_HOST}/example`; const DISCUSSION_PATH = `${TEST_HOST}/example`;
...@@ -58,7 +57,6 @@ describe('DiscussionFilter component', () => { ...@@ -58,7 +57,6 @@ describe('DiscussionFilter component', () => {
filters: discussionFiltersMock, filters: discussionFiltersMock,
selectedValue: DISCUSSION_FILTERS_DEFAULT_VALUE, selectedValue: DISCUSSION_FILTERS_DEFAULT_VALUE,
}, },
localVue,
}); });
}; };
......
/* global Mousetrap */ /* global Mousetrap */
import 'mousetrap'; import 'mousetrap';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue'; import Vue from 'vue';
import { import {
keysFor, keysFor,
...@@ -11,8 +11,6 @@ import DiscussionNavigator from '~/notes/components/discussion_navigator.vue'; ...@@ -11,8 +11,6 @@ import DiscussionNavigator from '~/notes/components/discussion_navigator.vue';
import eventHub from '~/notes/event_hub'; import eventHub from '~/notes/event_hub';
describe('notes/components/discussion_navigator', () => { describe('notes/components/discussion_navigator', () => {
const localVue = createLocalVue();
let wrapper; let wrapper;
let jumpToNextDiscussion; let jumpToNextDiscussion;
let jumpToPreviousDiscussion; let jumpToPreviousDiscussion;
...@@ -20,12 +18,12 @@ describe('notes/components/discussion_navigator', () => { ...@@ -20,12 +18,12 @@ describe('notes/components/discussion_navigator', () => {
const createComponent = () => { const createComponent = () => {
wrapper = shallowMount(DiscussionNavigator, { wrapper = shallowMount(DiscussionNavigator, {
mixins: [ mixins: [
localVue.extend({ {
methods: { methods: {
jumpToNextDiscussion, jumpToNextDiscussion,
jumpToPreviousDiscussion, jumpToPreviousDiscussion,
}, },
}), },
], ],
}); });
}; };
...@@ -48,7 +46,7 @@ describe('notes/components/discussion_navigator', () => { ...@@ -48,7 +46,7 @@ describe('notes/components/discussion_navigator', () => {
beforeEach(() => { beforeEach(() => {
onSpy = jest.spyOn(eventHub, '$on'); onSpy = jest.spyOn(eventHub, '$on');
vm = new (Vue.extend(DiscussionNavigator))(); vm = new Vue(DiscussionNavigator);
}); });
it('listens for jumpToFirstUnresolvedDiscussion events', () => { it('listens for jumpToFirstUnresolvedDiscussion events', () => {
......
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
import ResolveWithIssueButton from '~/notes/components/discussion_resolve_with_issue_button.vue'; import ResolveWithIssueButton from '~/notes/components/discussion_resolve_with_issue_button.vue';
const localVue = createLocalVue();
describe('ResolveWithIssueButton', () => { describe('ResolveWithIssueButton', () => {
let wrapper; let wrapper;
const url = `${TEST_HOST}/hello-world/`; const url = `${TEST_HOST}/hello-world/`;
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(ResolveWithIssueButton, { wrapper = shallowMount(ResolveWithIssueButton, {
localVue,
propsData: { propsData: {
url, url,
}, },
......
import { mount, createLocalVue, createWrapper } from '@vue/test-utils'; import { mount, createWrapper } from '@vue/test-utils';
import AxiosMockAdapter from 'axios-mock-adapter'; import AxiosMockAdapter from 'axios-mock-adapter';
import Vue from 'vue'; import Vue from 'vue';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
...@@ -20,11 +20,9 @@ describe('noteActions', () => { ...@@ -20,11 +20,9 @@ describe('noteActions', () => {
const findUserAccessRoleBadgeText = (idx) => findUserAccessRoleBadge(idx).text().trim(); const findUserAccessRoleBadgeText = (idx) => findUserAccessRoleBadge(idx).text().trim();
const mountNoteActions = (propsData, computed) => { const mountNoteActions = (propsData, computed) => {
const localVue = createLocalVue(); return mount(noteActions, {
return mount(localVue.extend(noteActions), {
store, store,
propsData, propsData,
localVue,
computed, computed,
}); });
}; };
......
import { GlSprintf } from '@gitlab/ui'; import { GlSprintf } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue'; import Vue, { nextTick } from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import NoteHeader from '~/notes/components/note_header.vue'; import NoteHeader from '~/notes/components/note_header.vue';
import { AVAILABILITY_STATUS } from '~/set_status_modal/utils'; import { AVAILABILITY_STATUS } from '~/set_status_modal/utils';
import UserNameWithStatus from '~/sidebar/components/assignees/user_name_with_status.vue'; import UserNameWithStatus from '~/sidebar/components/assignees/user_name_with_status.vue';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
const actions = { const actions = {
setTargetNoteHash: jest.fn(), setTargetNoteHash: jest.fn(),
...@@ -42,7 +41,6 @@ describe('NoteHeader component', () => { ...@@ -42,7 +41,6 @@ describe('NoteHeader component', () => {
const createComponent = (props) => { const createComponent = (props) => {
wrapper = shallowMount(NoteHeader, { wrapper = shallowMount(NoteHeader, {
localVue,
store: new Vuex.Store({ store: new Vuex.Store({
actions, actions,
}), }),
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import SortDiscussion from '~/notes/components/sort_discussion.vue'; import SortDiscussion from '~/notes/components/sort_discussion.vue';
import { ASC, DESC } from '~/notes/constants'; import { ASC, DESC } from '~/notes/constants';
...@@ -6,8 +7,7 @@ import createStore from '~/notes/stores'; ...@@ -6,8 +7,7 @@ import createStore from '~/notes/stores';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue'; import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Sort Discussion component', () => { describe('Sort Discussion component', () => {
let wrapper; let wrapper;
...@@ -17,7 +17,6 @@ describe('Sort Discussion component', () => { ...@@ -17,7 +17,6 @@ describe('Sort Discussion component', () => {
jest.spyOn(store, 'dispatch').mockImplementation(); jest.spyOn(store, 'dispatch').mockImplementation();
wrapper = shallowMount(SortDiscussion, { wrapper = shallowMount(SortDiscussion, {
localVue,
store, store,
}); });
}; };
......
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import TimelineToggle, { import TimelineToggle, {
timelineEnabledTooltip, timelineEnabledTooltip,
...@@ -10,8 +11,7 @@ import createStore from '~/notes/stores'; ...@@ -10,8 +11,7 @@ import createStore from '~/notes/stores';
import { trackToggleTimelineView } from '~/notes/utils'; import { trackToggleTimelineView } from '~/notes/utils';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Timeline toggle', () => { describe('Timeline toggle', () => {
let wrapper; let wrapper;
...@@ -23,7 +23,6 @@ describe('Timeline toggle', () => { ...@@ -23,7 +23,6 @@ describe('Timeline toggle', () => {
jest.spyOn(Tracking, 'event').mockImplementation(); jest.spyOn(Tracking, 'event').mockImplementation();
wrapper = shallowMount(TimelineToggle, { wrapper = shallowMount(TimelineToggle, {
localVue,
store, store,
}); });
}; };
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue'; import Vue, { nextTick } from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { setHTMLFixture } from 'helpers/fixtures'; import { setHTMLFixture } from 'helpers/fixtures';
import createEventHub from '~/helpers/event_hub_factory'; import createEventHub from '~/helpers/event_hub_factory';
...@@ -27,8 +27,7 @@ const createComponent = () => ({ ...@@ -27,8 +27,7 @@ const createComponent = () => ({
}); });
describe('Discussion navigation mixin', () => { describe('Discussion navigation mixin', () => {
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
let wrapper; let wrapper;
let store; let store;
...@@ -65,7 +64,7 @@ describe('Discussion navigation mixin', () => { ...@@ -65,7 +64,7 @@ describe('Discussion navigation mixin', () => {
}); });
store.state.notes.discussions = createDiscussions(); store.state.notes.discussions = createDiscussions();
wrapper = shallowMount(createComponent(), { store, localVue }); wrapper = shallowMount(createComponent(), { store });
}); });
afterEach(() => { afterEach(() => {
......
import { GlDropdown } from '@gitlab/ui'; import { GlDropdown } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import QuickstartDropdown from '~/packages_and_registries/shared/components/cli_commands.vue'; import QuickstartDropdown from '~/packages_and_registries/shared/components/cli_commands.vue';
import { import {
...@@ -16,8 +17,7 @@ import CodeInstruction from '~/vue_shared/components/registry/code_instruction.v ...@@ -16,8 +17,7 @@ import CodeInstruction from '~/vue_shared/components/registry/code_instruction.v
import { dockerCommands } from '../../mock_data'; import { dockerCommands } from '../../mock_data';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('cli_commands', () => { describe('cli_commands', () => {
let wrapper; let wrapper;
...@@ -27,7 +27,6 @@ describe('cli_commands', () => { ...@@ -27,7 +27,6 @@ describe('cli_commands', () => {
const mountComponent = () => { const mountComponent = () => {
wrapper = mount(QuickstartDropdown, { wrapper = mount(QuickstartDropdown, {
localVue,
propsData: { propsData: {
...dockerCommands, ...dockerCommands,
}, },
......
import { GlSprintf } from '@gitlab/ui'; import { GlSprintf } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import groupEmptyState from '~/packages_and_registries/container_registry/explorer/components/list_page/group_empty_state.vue'; import groupEmptyState from '~/packages_and_registries/container_registry/explorer/components/list_page/group_empty_state.vue';
import { GlEmptyState } from '../../stubs'; import { GlEmptyState } from '../../stubs';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Registry Group Empty state', () => { describe('Registry Group Empty state', () => {
let wrapper; let wrapper;
...@@ -16,7 +16,6 @@ describe('Registry Group Empty state', () => { ...@@ -16,7 +16,6 @@ describe('Registry Group Empty state', () => {
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(groupEmptyState, { wrapper = shallowMount(groupEmptyState, {
localVue,
stubs: { stubs: {
GlEmptyState, GlEmptyState,
GlSprintf, GlSprintf,
......
import { GlSprintf } from '@gitlab/ui'; import { GlSprintf } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import projectEmptyState from '~/packages_and_registries/container_registry/explorer/components/list_page/project_empty_state.vue'; import projectEmptyState from '~/packages_and_registries/container_registry/explorer/components/list_page/project_empty_state.vue';
import { dockerCommands } from '../../mock_data'; import { dockerCommands } from '../../mock_data';
import { GlEmptyState } from '../../stubs'; import { GlEmptyState } from '../../stubs';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Registry Project Empty state', () => { describe('Registry Project Empty state', () => {
let wrapper; let wrapper;
...@@ -21,7 +21,6 @@ describe('Registry Project Empty state', () => { ...@@ -21,7 +21,6 @@ describe('Registry Project Empty state', () => {
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(projectEmptyState, { wrapper = shallowMount(projectEmptyState, {
localVue,
stubs: { stubs: {
GlEmptyState, GlEmptyState,
GlSprintf, GlSprintf,
......
import { GlEmptyState } from '@gitlab/ui'; import { GlEmptyState } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { nextTick } from 'vue'; import Vue, { nextTick } from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { useMockLocationHelper } from 'helpers/mock_window_location_helper'; import { useMockLocationHelper } from 'helpers/mock_window_location_helper';
import stubChildren from 'helpers/stub_children'; import stubChildren from 'helpers/stub_children';
...@@ -19,8 +19,7 @@ import Tracking from '~/tracking'; ...@@ -19,8 +19,7 @@ import Tracking from '~/tracking';
import { mavenPackage, mavenFiles, npmPackage } from '../../mock_data'; import { mavenPackage, mavenFiles, npmPackage } from '../../mock_data';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
useMockLocationHelper(); useMockLocationHelper();
...@@ -60,7 +59,6 @@ describe('PackagesApp', () => { ...@@ -60,7 +59,6 @@ describe('PackagesApp', () => {
}); });
wrapper = mount(PackagesApp, { wrapper = mount(PackagesApp, {
localVue,
store, store,
stubs: { stubs: {
...stubChildren(PackagesApp), ...stubChildren(PackagesApp),
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import component from '~/packages_and_registries/infrastructure_registry/details/components/details_title.vue'; import component from '~/packages_and_registries/infrastructure_registry/details/components/details_title.vue';
import TitleArea from '~/vue_shared/components/registry/title_area.vue'; import TitleArea from '~/vue_shared/components/registry/title_area.vue';
import { terraformModule, mavenFiles, npmPackage } from '../../mock_data'; import { terraformModule, mavenFiles, npmPackage } from '../../mock_data';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('PackageTitle', () => { describe('PackageTitle', () => {
let wrapper; let wrapper;
...@@ -23,7 +23,6 @@ describe('PackageTitle', () => { ...@@ -23,7 +23,6 @@ describe('PackageTitle', () => {
}); });
wrapper = shallowMount(component, { wrapper = shallowMount(component, {
localVue,
store, store,
stubs: { stubs: {
TitleArea, TitleArea,
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import TerraformInstallation from '~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue'; import TerraformInstallation from '~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue';
import CodeInstructions from '~/vue_shared/components/registry/code_instruction.vue'; import CodeInstructions from '~/vue_shared/components/registry/code_instruction.vue';
import { terraformModule as packageEntity } from '../../mock_data'; import { terraformModule as packageEntity } from '../../mock_data';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('TerraformInstallation', () => { describe('TerraformInstallation', () => {
let wrapper; let wrapper;
...@@ -22,7 +22,6 @@ describe('TerraformInstallation', () => { ...@@ -22,7 +22,6 @@ describe('TerraformInstallation', () => {
function createComponent() { function createComponent() {
wrapper = shallowMount(TerraformInstallation, { wrapper = shallowMount(TerraformInstallation, {
localVue,
store, store,
}); });
} }
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import component from '~/packages_and_registries/infrastructure_registry/list/components/infrastructure_search.vue'; import component from '~/packages_and_registries/infrastructure_registry/list/components/infrastructure_search.vue';
import RegistrySearch from '~/vue_shared/components/registry/registry_search.vue'; import RegistrySearch from '~/vue_shared/components/registry/registry_search.vue';
import UrlSync from '~/vue_shared/components/url_sync.vue'; import UrlSync from '~/vue_shared/components/url_sync.vue';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Infrastructure Search', () => { describe('Infrastructure Search', () => {
let wrapper; let wrapper;
...@@ -48,7 +48,6 @@ describe('Infrastructure Search', () => { ...@@ -48,7 +48,6 @@ describe('Infrastructure Search', () => {
createStore(isGroupPage); createStore(isGroupPage);
wrapper = shallowMount(component, { wrapper = shallowMount(component, {
localVue,
store, store,
stubs: { stubs: {
UrlSync, UrlSync,
......
import { GlEmptyState, GlSprintf, GlLink } from '@gitlab/ui'; import { GlEmptyState, GlSprintf, GlLink } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import setWindowLocation from 'helpers/set_window_location_helper'; import setWindowLocation from 'helpers/set_window_location_helper';
import createFlash from '~/flash'; import createFlash from '~/flash';
...@@ -17,8 +18,7 @@ import InfrastructureSearch from '~/packages_and_registries/infrastructure_regis ...@@ -17,8 +18,7 @@ import InfrastructureSearch from '~/packages_and_registries/infrastructure_regis
jest.mock('~/lib/utils/common_utils'); jest.mock('~/lib/utils/common_utils');
jest.mock('~/flash'); jest.mock('~/flash');
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('packages_list_app', () => { describe('packages_list_app', () => {
let wrapper; let wrapper;
...@@ -53,7 +53,6 @@ describe('packages_list_app', () => { ...@@ -53,7 +53,6 @@ describe('packages_list_app', () => {
const mountComponent = (provide) => { const mountComponent = (provide) => {
wrapper = shallowMount(PackageListApp, { wrapper = shallowMount(PackageListApp, {
localVue,
store, store,
stubs: { stubs: {
GlEmptyState, GlEmptyState,
......
import { GlTable, GlPagination, GlModal } from '@gitlab/ui'; import { GlTable, GlPagination, GlModal } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue';
import { last } from 'lodash'; import { last } from 'lodash';
import Vuex from 'vuex'; import Vuex from 'vuex';
import stubChildren from 'helpers/stub_children'; import stubChildren from 'helpers/stub_children';
...@@ -11,8 +12,7 @@ import { TRACK_CATEGORY } from '~/packages_and_registries/infrastructure_registr ...@@ -11,8 +12,7 @@ import { TRACK_CATEGORY } from '~/packages_and_registries/infrastructure_registr
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import { packageList } from '../../mock_data'; import { packageList } from '../../mock_data';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('packages_list', () => { describe('packages_list', () => {
let wrapper; let wrapper;
...@@ -61,7 +61,6 @@ describe('packages_list', () => { ...@@ -61,7 +61,6 @@ describe('packages_list', () => {
createStore(isGroupPage, packages, isLoading); createStore(isGroupPage, packages, isLoading);
wrapper = mount(PackagesList, { wrapper = mount(PackagesList, {
localVue,
store, store,
stubs: { stubs: {
...stubChildren(PackagesList), ...stubChildren(PackagesList),
......
import { GlSprintf } from '@gitlab/ui'; import { GlSprintf } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils'; import Vue from 'vue';
import VueRouter from 'vue-router'; import VueRouter from 'vue-router';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
...@@ -17,8 +17,7 @@ import { PACKAGE_ERROR_STATUS } from '~/packages_and_registries/package_registry ...@@ -17,8 +17,7 @@ import { PACKAGE_ERROR_STATUS } from '~/packages_and_registries/package_registry
import ListItem from '~/vue_shared/components/registry/list_item.vue'; import ListItem from '~/vue_shared/components/registry/list_item.vue';
import { packageData, packagePipelines, packageProject, packageTags } from '../../mock_data'; import { packageData, packagePipelines, packageProject, packageTags } from '../../mock_data';
const localVue = createLocalVue(); Vue.use(VueRouter);
localVue.use(VueRouter);
describe('packages_list_row', () => { describe('packages_list_row', () => {
let wrapper; let wrapper;
...@@ -47,7 +46,6 @@ describe('packages_list_row', () => { ...@@ -47,7 +46,6 @@ describe('packages_list_row', () => {
provide = defaultProvide, provide = defaultProvide,
} = {}) => { } = {}) => {
wrapper = shallowMountExtended(PackagesListRow, { wrapper = shallowMountExtended(PackagesListRow, {
localVue,
provide, provide,
stubs: { stubs: {
ListItem, ListItem,
......
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import { GlFormTextarea, GlFormInput, GlLoadingIcon } from '@gitlab/ui'; import { GlFormTextarea, GlFormInput, GlLoadingIcon } from '@gitlab/ui';
import { createLocalVue, mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue';
import createMockApollo from 'helpers/mock_apollo_helper'; import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { objectToQuery, redirectTo } from '~/lib/utils/url_utility'; import { objectToQuery, redirectTo } from '~/lib/utils/url_utility';
...@@ -26,8 +27,6 @@ import { ...@@ -26,8 +27,6 @@ import {
mockNewMergeRequestPath, mockNewMergeRequestPath,
} from '../../mock_data'; } from '../../mock_data';
const localVue = createLocalVue();
jest.mock('~/lib/utils/url_utility', () => ({ jest.mock('~/lib/utils/url_utility', () => ({
redirectTo: jest.fn(), redirectTo: jest.fn(),
refreshCurrentPage: jest.fn(), refreshCurrentPage: jest.fn(),
...@@ -79,11 +78,10 @@ describe('Pipeline Editor | Commit section', () => { ...@@ -79,11 +78,10 @@ describe('Pipeline Editor | Commit section', () => {
const createComponentWithApollo = (options) => { const createComponentWithApollo = (options) => {
const handlers = [[commitCreate, mockMutateCommitData]]; const handlers = [[commitCreate, mockMutateCommitData]];
localVue.use(VueApollo); Vue.use(VueApollo);
mockApollo = createMockApollo(handlers); mockApollo = createMockApollo(handlers);
const apolloConfig = { const apolloConfig = {
localVue,
apolloProvider: mockApollo, apolloProvider: mockApollo,
}; };
......
import { GlModal } from '@gitlab/ui'; import { GlModal } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import TestCaseDetails from '~/pipelines/components/test_reports/test_case_details.vue'; import TestCaseDetails from '~/pipelines/components/test_reports/test_case_details.vue';
import CodeBlock from '~/vue_shared/components/code_block.vue'; import CodeBlock from '~/vue_shared/components/code_block.vue';
const localVue = createLocalVue();
describe('Test case details', () => { describe('Test case details', () => {
let wrapper; let wrapper;
const defaultTestCase = { const defaultTestCase = {
...@@ -29,7 +27,6 @@ describe('Test case details', () => { ...@@ -29,7 +27,6 @@ describe('Test case details', () => {
const createComponent = (testCase = {}) => { const createComponent = (testCase = {}) => {
wrapper = extendedWrapper( wrapper = extendedWrapper(
shallowMount(TestCaseDetails, { shallowMount(TestCaseDetails, {
localVue,
propsData: { propsData: {
modalId: 'my-modal', modalId: 'my-modal',
testCase: { testCase: {
......
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import testReports from 'test_fixtures/pipelines/test_report.json'; import testReports from 'test_fixtures/pipelines/test_report.json';
import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { extendedWrapper } from 'helpers/vue_test_utils_helper';
...@@ -9,8 +10,7 @@ import TestSummary from '~/pipelines/components/test_reports/test_summary.vue'; ...@@ -9,8 +10,7 @@ import TestSummary from '~/pipelines/components/test_reports/test_summary.vue';
import TestSummaryTable from '~/pipelines/components/test_reports/test_summary_table.vue'; import TestSummaryTable from '~/pipelines/components/test_reports/test_summary_table.vue';
import * as getters from '~/pipelines/stores/test_reports/getters'; import * as getters from '~/pipelines/stores/test_reports/getters';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Test reports app', () => { describe('Test reports app', () => {
let wrapper; let wrapper;
...@@ -44,7 +44,6 @@ describe('Test reports app', () => { ...@@ -44,7 +44,6 @@ describe('Test reports app', () => {
wrapper = extendedWrapper( wrapper = extendedWrapper(
shallowMount(TestReports, { shallowMount(TestReports, {
store, store,
localVue,
}), }),
); );
}; };
......
import { GlButton, GlFriendlyWrap, GlLink, GlPagination } from '@gitlab/ui'; import { GlButton, GlFriendlyWrap, GlLink, GlPagination } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import testReports from 'test_fixtures/pipelines/test_report.json'; import testReports from 'test_fixtures/pipelines/test_report.json';
import SuiteTable from '~/pipelines/components/test_reports/test_suite_table.vue'; import SuiteTable from '~/pipelines/components/test_reports/test_suite_table.vue';
...@@ -8,8 +9,7 @@ import * as getters from '~/pipelines/stores/test_reports/getters'; ...@@ -8,8 +9,7 @@ import * as getters from '~/pipelines/stores/test_reports/getters';
import { formatFilePath } from '~/pipelines/stores/test_reports/utils'; import { formatFilePath } from '~/pipelines/stores/test_reports/utils';
import skippedTestCases from './mock_data'; import skippedTestCases from './mock_data';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Test reports suite table', () => { describe('Test reports suite table', () => {
let wrapper; let wrapper;
...@@ -47,7 +47,6 @@ describe('Test reports suite table', () => { ...@@ -47,7 +47,6 @@ describe('Test reports suite table', () => {
wrapper = shallowMount(SuiteTable, { wrapper = shallowMount(SuiteTable, {
store, store,
localVue,
stubs: { GlFriendlyWrap }, stubs: { GlFriendlyWrap },
}); });
}; };
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import testReports from 'test_fixtures/pipelines/test_report.json'; import testReports from 'test_fixtures/pipelines/test_report.json';
import SummaryTable from '~/pipelines/components/test_reports/test_summary_table.vue'; import SummaryTable from '~/pipelines/components/test_reports/test_summary_table.vue';
import * as getters from '~/pipelines/stores/test_reports/getters'; import * as getters from '~/pipelines/stores/test_reports/getters';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Test reports summary table', () => { describe('Test reports summary table', () => {
let wrapper; let wrapper;
...@@ -29,7 +29,6 @@ describe('Test reports summary table', () => { ...@@ -29,7 +29,6 @@ describe('Test reports summary table', () => {
wrapper = mount(SummaryTable, { wrapper = mount(SummaryTable, {
propsData: defaultProps, propsData: defaultProps,
store, store,
localVue,
}); });
}; };
......
import { GlDropdown, GlDropdownSectionHeader, GlSearchBoxByType, GlDropdownItem } from '@gitlab/ui'; import { GlDropdown, GlDropdownSectionHeader, GlSearchBoxByType, GlDropdownItem } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import * as urlUtility from '~/lib/utils/url_utility'; import * as urlUtility from '~/lib/utils/url_utility';
import AuthorSelect from '~/projects/commits/components/author_select.vue'; import AuthorSelect from '~/projects/commits/components/author_select.vue';
import { createStore } from '~/projects/commits/store'; import { createStore } from '~/projects/commits/store';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
const commitsPath = 'author/search/url'; const commitsPath = 'author/search/url';
const currentAuthor = 'lorem'; const currentAuthor = 'lorem';
...@@ -38,7 +38,6 @@ describe('Author Select', () => { ...@@ -38,7 +38,6 @@ describe('Author Select', () => {
`); `);
wrapper = shallowMount(AuthorSelect, { wrapper = shallowMount(AuthorSelect, {
localVue,
store: new Vuex.Store(store), store: new Vuex.Store(store),
propsData: { propsData: {
projectCommitsEl: document.querySelector('.js-project-commits-show'), projectCommitsEl: document.querySelector('.js-project-commits-show'),
......
import { GlLoadingIcon, GlSearchBoxByType, GlDropdownItem, GlDropdown, GlIcon } from '@gitlab/ui'; import { GlLoadingIcon, GlSearchBoxByType, GlDropdownItem, GlDropdown, GlIcon } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import axios from 'axios'; import axios from 'axios';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { merge, last } from 'lodash'; import { merge, last } from 'lodash';
...@@ -20,8 +21,7 @@ import { ...@@ -20,8 +21,7 @@ import {
} from '~/ref/constants'; } from '~/ref/constants';
import createStore from '~/ref/stores/'; import createStore from '~/ref/stores/';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Ref selector component', () => { describe('Ref selector component', () => {
const fixtures = { branches, tags, commit }; const fixtures = { branches, tags, commit };
...@@ -52,7 +52,6 @@ describe('Ref selector component', () => { ...@@ -52,7 +52,6 @@ describe('Ref selector component', () => {
stubs: { stubs: {
GlSearchBoxByType: true, GlSearchBoxByType: true,
}, },
localVue,
store: createStore(), store: createStore(),
}, },
mountOverrides, mountOverrides,
...@@ -223,7 +222,7 @@ describe('Ref selector component', () => { ...@@ -223,7 +222,7 @@ describe('Ref selector component', () => {
it('renders the updated ref name', () => { it('renders the updated ref name', () => {
wrapper.setProps({ value: updatedRef }); wrapper.setProps({ value: updatedRef });
return localVue.nextTick().then(() => { return nextTick().then(() => {
expect(findButtonContent().text()).toBe(updatedRef); expect(findButtonContent().text()).toBe(updatedRef);
}); });
}); });
...@@ -547,7 +546,7 @@ describe('Ref selector component', () => { ...@@ -547,7 +546,7 @@ describe('Ref selector component', () => {
await selectFirstBranch(); await selectFirstBranch();
return localVue.nextTick().then(() => { return nextTick().then(() => {
expect(findButtonContent().text()).toBe(fixtures.branches[0].name); expect(findButtonContent().text()).toBe(fixtures.branches[0].name);
}); });
}); });
...@@ -567,7 +566,7 @@ describe('Ref selector component', () => { ...@@ -567,7 +566,7 @@ describe('Ref selector component', () => {
await selectFirstTag(); await selectFirstTag();
return localVue.nextTick().then(() => { return nextTick().then(() => {
expect(findButtonContent().text()).toBe(fixtures.tags[0].name); expect(findButtonContent().text()).toBe(fixtures.tags[0].name);
}); });
}); });
...@@ -587,7 +586,7 @@ describe('Ref selector component', () => { ...@@ -587,7 +586,7 @@ describe('Ref selector component', () => {
await selectFirstCommit(); await selectFirstCommit();
return localVue.nextTick().then(() => { return nextTick().then(() => {
expect(findButtonContent().text()).toBe(fixtures.commit.id); expect(findButtonContent().text()).toBe(fixtures.commit.id);
}); });
}); });
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import originalRelease from 'test_fixtures/api/releases/release.json'; import originalRelease from 'test_fixtures/api/releases/release.json';
import * as commonUtils from '~/lib/utils/common_utils'; import * as commonUtils from '~/lib/utils/common_utils';
...@@ -6,8 +7,7 @@ import { ENTER_KEY } from '~/lib/utils/keys'; ...@@ -6,8 +7,7 @@ import { ENTER_KEY } from '~/lib/utils/keys';
import AssetLinksForm from '~/releases/components/asset_links_form.vue'; import AssetLinksForm from '~/releases/components/asset_links_form.vue';
import { ASSET_LINK_TYPE, DEFAULT_ASSET_LINK_TYPE } from '~/releases/constants'; import { ASSET_LINK_TYPE, DEFAULT_ASSET_LINK_TYPE } from '~/releases/constants';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Release edit component', () => { describe('Release edit component', () => {
let wrapper; let wrapper;
...@@ -52,7 +52,6 @@ describe('Release edit component', () => { ...@@ -52,7 +52,6 @@ describe('Release edit component', () => {
}); });
wrapper = mount(AssetLinksForm, { wrapper = mount(AssetLinksForm, {
localVue,
store, store,
}); });
}; };
......
import { GlKeysetPagination } from '@gitlab/ui'; import { GlKeysetPagination } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { historyPushState } from '~/lib/utils/common_utils'; import { historyPushState } from '~/lib/utils/common_utils';
import ReleasesPagination from '~/releases/components/releases_pagination.vue'; import ReleasesPagination from '~/releases/components/releases_pagination.vue';
...@@ -11,8 +12,7 @@ jest.mock('~/lib/utils/common_utils', () => ({ ...@@ -11,8 +12,7 @@ jest.mock('~/lib/utils/common_utils', () => ({
historyPushState: jest.fn(), historyPushState: jest.fn(),
})); }));
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('~/releases/components/releases_pagination.vue', () => { describe('~/releases/components/releases_pagination.vue', () => {
let wrapper; let wrapper;
...@@ -39,7 +39,6 @@ describe('~/releases/components/releases_pagination.vue', () => { ...@@ -39,7 +39,6 @@ describe('~/releases/components/releases_pagination.vue', () => {
}, },
featureFlags: {}, featureFlags: {},
}), }),
localVue,
}); });
}; };
......
import { GlSorting, GlSortingItem } from '@gitlab/ui'; import { GlSorting, GlSortingItem } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import ReleasesSort from '~/releases/components/releases_sort.vue'; import ReleasesSort from '~/releases/components/releases_sort.vue';
import createStore from '~/releases/stores'; import createStore from '~/releases/stores';
import createIndexModule from '~/releases/stores/modules/index'; import createIndexModule from '~/releases/stores/modules/index';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('~/releases/components/releases_sort.vue', () => { describe('~/releases/components/releases_sort.vue', () => {
let wrapper; let wrapper;
...@@ -30,7 +30,6 @@ describe('~/releases/components/releases_sort.vue', () => { ...@@ -30,7 +30,6 @@ describe('~/releases/components/releases_sort.vue', () => {
stubs: { stubs: {
GlSortingItem, GlSortingItem,
}, },
localVue,
}); });
}; };
......
import { GlFormInput } from '@gitlab/ui'; import { GlFormInput } from '@gitlab/ui';
import { shallowMount, mount, createLocalVue } from '@vue/test-utils'; import { shallowMount, mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import TagFieldExisting from '~/releases/components/tag_field_existing.vue'; import TagFieldExisting from '~/releases/components/tag_field_existing.vue';
import createStore from '~/releases/stores'; import createStore from '~/releases/stores';
...@@ -7,8 +8,7 @@ import createEditNewModule from '~/releases/stores/modules/edit_new'; ...@@ -7,8 +8,7 @@ import createEditNewModule from '~/releases/stores/modules/edit_new';
const TEST_TAG_NAME = 'test-tag-name'; const TEST_TAG_NAME = 'test-tag-name';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('releases/components/tag_field_existing', () => { describe('releases/components/tag_field_existing', () => {
let store; let store;
...@@ -17,7 +17,6 @@ describe('releases/components/tag_field_existing', () => { ...@@ -17,7 +17,6 @@ describe('releases/components/tag_field_existing', () => {
const createComponent = (mountFn = shallowMount) => { const createComponent = (mountFn = shallowMount) => {
wrapper = mountFn(TagFieldExisting, { wrapper = mountFn(TagFieldExisting, {
store, store,
localVue,
}); });
}; };
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import AccessibilityIssueBody from '~/reports/accessibility_report/components/accessibility_issue_body.vue'; import AccessibilityIssueBody from '~/reports/accessibility_report/components/accessibility_issue_body.vue';
import GroupedAccessibilityReportsApp from '~/reports/accessibility_report/grouped_accessibility_reports_app.vue'; import GroupedAccessibilityReportsApp from '~/reports/accessibility_report/grouped_accessibility_reports_app.vue';
import { getStoreConfig } from '~/reports/accessibility_report/store'; import { getStoreConfig } from '~/reports/accessibility_report/store';
import { mockReport } from './mock_data'; import { mockReport } from './mock_data';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Grouped accessibility reports app', () => { describe('Grouped accessibility reports app', () => {
const Component = localVue.extend(GroupedAccessibilityReportsApp);
let wrapper; let wrapper;
let mockStore; let mockStore;
const mountComponent = () => { const mountComponent = () => {
wrapper = mount(Component, { wrapper = mount(GroupedAccessibilityReportsApp, {
store: mockStore, store: mockStore,
localVue,
propsData: { propsData: {
endpoint: 'endpoint.json', endpoint: 'endpoint.json',
}, },
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import CodequalityIssueBody from '~/reports/codequality_report/components/codequality_issue_body.vue'; import CodequalityIssueBody from '~/reports/codequality_report/components/codequality_issue_body.vue';
import GroupedCodequalityReportsApp from '~/reports/codequality_report/grouped_codequality_reports_app.vue'; import GroupedCodequalityReportsApp from '~/reports/codequality_report/grouped_codequality_reports_app.vue';
...@@ -6,8 +7,7 @@ import { getStoreConfig } from '~/reports/codequality_report/store'; ...@@ -6,8 +7,7 @@ import { getStoreConfig } from '~/reports/codequality_report/store';
import { STATUS_NOT_FOUND } from '~/reports/constants'; import { STATUS_NOT_FOUND } from '~/reports/constants';
import { parsedReportIssues } from './mock_data'; import { parsedReportIssues } from './mock_data';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Grouped code quality reports app', () => { describe('Grouped code quality reports app', () => {
let wrapper; let wrapper;
...@@ -22,7 +22,6 @@ describe('Grouped code quality reports app', () => { ...@@ -22,7 +22,6 @@ describe('Grouped code quality reports app', () => {
const mountComponent = (props = {}) => { const mountComponent = (props = {}) => {
wrapper = mount(GroupedCodequalityReportsApp, { wrapper = mount(GroupedCodequalityReportsApp, {
store: mockStore, store: mockStore,
localVue,
propsData: { propsData: {
...PATHS, ...PATHS,
...props, ...props,
......
import { GlBadge, GlButton } from '@gitlab/ui'; import { GlBadge, GlButton } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import IssueStatusIcon from '~/reports/components/issue_status_icon.vue'; import IssueStatusIcon from '~/reports/components/issue_status_icon.vue';
import TestIssueBody from '~/reports/grouped_test_report/components/test_issue_body.vue'; import TestIssueBody from '~/reports/grouped_test_report/components/test_issue_body.vue';
import { failedIssue, successIssue } from '../../mock_data/mock_data'; import { failedIssue, successIssue } from '../../mock_data/mock_data';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Test issue body', () => { describe('Test issue body', () => {
let wrapper; let wrapper;
...@@ -29,7 +29,6 @@ describe('Test issue body', () => { ...@@ -29,7 +29,6 @@ describe('Test issue body', () => {
wrapper = extendedWrapper( wrapper = extendedWrapper(
shallowMount(TestIssueBody, { shallowMount(TestIssueBody, {
store, store,
localVue,
propsData: { propsData: {
issue, issue,
}, },
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import Api from '~/api'; import Api from '~/api';
import GroupedTestReportsApp from '~/reports/grouped_test_report/grouped_test_reports_app.vue'; import GroupedTestReportsApp from '~/reports/grouped_test_report/grouped_test_reports_app.vue';
...@@ -14,8 +15,7 @@ import resolvedFailures from '../mock_data/resolved_failures.json'; ...@@ -14,8 +15,7 @@ import resolvedFailures from '../mock_data/resolved_failures.json';
jest.mock('~/api.js'); jest.mock('~/api.js');
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('Grouped test reports app', () => { describe('Grouped test reports app', () => {
const endpoint = 'endpoint.json'; const endpoint = 'endpoint.json';
...@@ -27,7 +27,6 @@ describe('Grouped test reports app', () => { ...@@ -27,7 +27,6 @@ describe('Grouped test reports app', () => {
const mountComponent = ({ props = { pipelinePath } } = {}) => { const mountComponent = ({ props = { pipelinePath } } = {}) => {
wrapper = mount(GroupedTestReportsApp, { wrapper = mount(GroupedTestReportsApp, {
store: mockStore, store: mockStore,
localVue,
propsData: { propsData: {
endpoint, endpoint,
headBlobPath, headBlobPath,
......
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { MOCK_QUERY } from 'jest/search/mock_data'; import { MOCK_QUERY } from 'jest/search/mock_data';
import ConfidentialityFilter from '~/search/sidebar/components/confidentiality_filter.vue'; import ConfidentialityFilter from '~/search/sidebar/components/confidentiality_filter.vue';
import RadioFilter from '~/search/sidebar/components/radio_filter.vue'; import RadioFilter from '~/search/sidebar/components/radio_filter.vue';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('ConfidentialityFilter', () => { describe('ConfidentialityFilter', () => {
let wrapper; let wrapper;
...@@ -25,7 +25,6 @@ describe('ConfidentialityFilter', () => { ...@@ -25,7 +25,6 @@ describe('ConfidentialityFilter', () => {
}); });
wrapper = shallowMount(ConfidentialityFilter, { wrapper = shallowMount(ConfidentialityFilter, {
localVue,
store, store,
}); });
}; };
......
import { GlFormRadioGroup, GlFormRadio } from '@gitlab/ui'; import { GlFormRadioGroup, GlFormRadio } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { MOCK_QUERY } from 'jest/search/mock_data'; import { MOCK_QUERY } from 'jest/search/mock_data';
import RadioFilter from '~/search/sidebar/components/radio_filter.vue'; import RadioFilter from '~/search/sidebar/components/radio_filter.vue';
import { confidentialFilterData } from '~/search/sidebar/constants/confidential_filter_data'; import { confidentialFilterData } from '~/search/sidebar/constants/confidential_filter_data';
import { stateFilterData } from '~/search/sidebar/constants/state_filter_data'; import { stateFilterData } from '~/search/sidebar/constants/state_filter_data';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('RadioFilter', () => { describe('RadioFilter', () => {
let wrapper; let wrapper;
...@@ -30,7 +30,6 @@ describe('RadioFilter', () => { ...@@ -30,7 +30,6 @@ describe('RadioFilter', () => {
}); });
wrapper = shallowMount(RadioFilter, { wrapper = shallowMount(RadioFilter, {
localVue,
store, store,
propsData: { propsData: {
...defaultProps, ...defaultProps,
......
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { MOCK_QUERY } from 'jest/search/mock_data'; import { MOCK_QUERY } from 'jest/search/mock_data';
import RadioFilter from '~/search/sidebar/components/radio_filter.vue'; import RadioFilter from '~/search/sidebar/components/radio_filter.vue';
import StatusFilter from '~/search/sidebar/components/status_filter.vue'; import StatusFilter from '~/search/sidebar/components/status_filter.vue';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('StatusFilter', () => { describe('StatusFilter', () => {
let wrapper; let wrapper;
...@@ -25,7 +25,6 @@ describe('StatusFilter', () => { ...@@ -25,7 +25,6 @@ describe('StatusFilter', () => {
}); });
wrapper = shallowMount(StatusFilter, { wrapper = shallowMount(StatusFilter, {
localVue,
store, store,
}); });
}; };
......
import { GlButtonGroup, GlButton, GlDropdown, GlDropdownItem } from '@gitlab/ui'; import { GlButtonGroup, GlButton, GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { MOCK_QUERY, MOCK_SORT_OPTIONS } from 'jest/search/mock_data'; import { MOCK_QUERY, MOCK_SORT_OPTIONS } from 'jest/search/mock_data';
import GlobalSearchSort from '~/search/sort/components/app.vue'; import GlobalSearchSort from '~/search/sort/components/app.vue';
import { SORT_DIRECTION_UI } from '~/search/sort/constants'; import { SORT_DIRECTION_UI } from '~/search/sort/constants';
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('GlobalSearchSort', () => { describe('GlobalSearchSort', () => {
let wrapper; let wrapper;
...@@ -30,7 +30,6 @@ describe('GlobalSearchSort', () => { ...@@ -30,7 +30,6 @@ describe('GlobalSearchSort', () => {
}); });
wrapper = shallowMount(GlobalSearchSort, { wrapper = shallowMount(GlobalSearchSort, {
localVue,
store, store,
propsData: { propsData: {
...defaultProps, ...defaultProps,
......
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import functionDetailsComponent from '~/serverless/components/function_details.vue'; import functionDetailsComponent from '~/serverless/components/function_details.vue';
import { createStore } from '~/serverless/store'; import { createStore } from '~/serverless/store';
describe('functionDetailsComponent', () => { describe('functionDetailsComponent', () => {
let localVue;
let component; let component;
let store; let store;
beforeEach(() => { beforeEach(() => {
localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
store = createStore({ clustersPath: '/clusters', helpPath: '/help' }); store = createStore({ clustersPath: '/clusters', helpPath: '/help' });
}); });
...@@ -33,7 +32,6 @@ describe('functionDetailsComponent', () => { ...@@ -33,7 +32,6 @@ describe('functionDetailsComponent', () => {
it('has a name, description, URL, and no pods loaded', () => { it('has a name, description, URL, and no pods loaded', () => {
component = shallowMount(functionDetailsComponent, { component = shallowMount(functionDetailsComponent, {
localVue,
store, store,
propsData: { propsData: {
func: serviceStub, func: serviceStub,
...@@ -58,7 +56,6 @@ describe('functionDetailsComponent', () => { ...@@ -58,7 +56,6 @@ describe('functionDetailsComponent', () => {
serviceStub.podcount = 1; serviceStub.podcount = 1;
component = shallowMount(functionDetailsComponent, { component = shallowMount(functionDetailsComponent, {
localVue,
store, store,
propsData: { propsData: {
func: serviceStub, func: serviceStub,
...@@ -73,7 +70,6 @@ describe('functionDetailsComponent', () => { ...@@ -73,7 +70,6 @@ describe('functionDetailsComponent', () => {
serviceStub.podcount = 3; serviceStub.podcount = 3;
component = shallowMount(functionDetailsComponent, { component = shallowMount(functionDetailsComponent, {
localVue,
store, store,
propsData: { propsData: {
func: serviceStub, func: serviceStub,
...@@ -88,7 +84,6 @@ describe('functionDetailsComponent', () => { ...@@ -88,7 +84,6 @@ describe('functionDetailsComponent', () => {
serviceStub.description = null; serviceStub.description = null;
component = shallowMount(functionDetailsComponent, { component = shallowMount(functionDetailsComponent, {
localVue,
store, store,
propsData: { propsData: {
func: serviceStub, func: serviceStub,
......
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import AxiosMockAdapter from 'axios-mock-adapter'; import AxiosMockAdapter from 'axios-mock-adapter';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
...@@ -15,15 +16,13 @@ describe('functionsComponent', () => { ...@@ -15,15 +16,13 @@ describe('functionsComponent', () => {
let component; let component;
let store; let store;
let localVue;
let axiosMock; let axiosMock;
beforeEach(() => { beforeEach(() => {
axiosMock = new AxiosMockAdapter(axios); axiosMock = new AxiosMockAdapter(axios);
axiosMock.onGet(statusPath).reply(200); axiosMock.onGet(statusPath).reply(200);
localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
store = createStore({}); store = createStore({});
}); });
...@@ -35,21 +34,21 @@ describe('functionsComponent', () => { ...@@ -35,21 +34,21 @@ describe('functionsComponent', () => {
it('should render empty state when Knative is not installed', () => { it('should render empty state when Knative is not installed', () => {
store.dispatch('receiveFunctionsSuccess', { knative_installed: false }); store.dispatch('receiveFunctionsSuccess', { knative_installed: false });
component = shallowMount(functionsComponent, { localVue, store }); component = shallowMount(functionsComponent, { store });
expect(component.find(EmptyState).exists()).toBe(true); expect(component.find(EmptyState).exists()).toBe(true);
}); });
it('should render a loading component', () => { it('should render a loading component', () => {
store.dispatch('requestFunctionsLoading'); store.dispatch('requestFunctionsLoading');
component = shallowMount(functionsComponent, { localVue, store }); component = shallowMount(functionsComponent, { store });
expect(component.find(GlLoadingIcon).exists()).toBe(true); expect(component.find(GlLoadingIcon).exists()).toBe(true);
}); });
it('should render empty state when there is no function data', () => { it('should render empty state when there is no function data', () => {
store.dispatch('receiveFunctionsNoDataSuccess', { knative_installed: true }); store.dispatch('receiveFunctionsNoDataSuccess', { knative_installed: true });
component = shallowMount(functionsComponent, { localVue, store }); component = shallowMount(functionsComponent, { store });
expect( expect(
component.vm.$el component.vm.$el
...@@ -68,7 +67,7 @@ describe('functionsComponent', () => { ...@@ -68,7 +67,7 @@ describe('functionsComponent', () => {
knative_installed: 'checking', knative_installed: 'checking',
}); });
component = shallowMount(functionsComponent, { localVue, store }); component = shallowMount(functionsComponent, { store });
expect(component.find('.js-functions-wrapper').exists()).toBe(true); expect(component.find('.js-functions-wrapper').exists()).toBe(true);
expect(component.find('.js-functions-loader').exists()).toBe(true); expect(component.find('.js-functions-loader').exists()).toBe(true);
...@@ -77,7 +76,7 @@ describe('functionsComponent', () => { ...@@ -77,7 +76,7 @@ describe('functionsComponent', () => {
it('should render the functions list', () => { it('should render the functions list', () => {
store = createStore({ clustersPath: 'clustersPath', helpPath: 'helpPath', statusPath }); store = createStore({ clustersPath: 'clustersPath', helpPath: 'helpPath', statusPath });
component = shallowMount(functionsComponent, { localVue, store }); component = shallowMount(functionsComponent, { store });
component.vm.$store.dispatch('receiveFunctionsSuccess', mockServerlessFunctions); component.vm.$store.dispatch('receiveFunctionsSuccess', mockServerlessFunctions);
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { mockTracking, unmockTracking } from 'helpers/tracking_helper'; import { mockTracking, unmockTracking } from 'helpers/tracking_helper';
import EditArea from '~/static_site_editor/components/edit_area.vue'; import EditArea from '~/static_site_editor/components/edit_area.vue';
import EditMetaModal from '~/static_site_editor/components/edit_meta_modal.vue'; import EditMetaModal from '~/static_site_editor/components/edit_meta_modal.vue';
...@@ -29,8 +29,6 @@ import { ...@@ -29,8 +29,6 @@ import {
imageRoot, imageRoot,
} from '../mock_data'; } from '../mock_data';
const localVue = createLocalVue();
describe('static_site_editor/pages/home', () => { describe('static_site_editor/pages/home', () => {
let wrapper; let wrapper;
let store; let store;
...@@ -78,7 +76,6 @@ describe('static_site_editor/pages/home', () => { ...@@ -78,7 +76,6 @@ describe('static_site_editor/pages/home', () => {
const buildWrapper = (data = {}) => { const buildWrapper = (data = {}) => {
wrapper = shallowMount(Home, { wrapper = shallowMount(Home, {
localVue,
store, store,
mocks: { mocks: {
$apollo, $apollo,
......
import { GlAlert, GlLoadingIcon } from '@gitlab/ui'; import { GlAlert, GlLoadingIcon } from '@gitlab/ui';
import { createLocalVue, mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue'; import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
...@@ -13,8 +13,7 @@ import { userList } from '../../feature_flags/mock_data'; ...@@ -13,8 +13,7 @@ import { userList } from '../../feature_flags/mock_data';
jest.mock('~/api'); jest.mock('~/api');
jest.mock('~/lib/utils/url_utility'); jest.mock('~/lib/utils/url_utility');
const localVue = createLocalVue(Vue); Vue.use(Vuex);
localVue.use(Vuex);
describe('user_lists/components/edit_user_list', () => { describe('user_lists/components/edit_user_list', () => {
let wrapper; let wrapper;
...@@ -30,7 +29,6 @@ describe('user_lists/components/edit_user_list', () => { ...@@ -30,7 +29,6 @@ describe('user_lists/components/edit_user_list', () => {
destroy(); destroy();
wrapper = mount(EditUserList, { wrapper = mount(EditUserList, {
localVue,
store: createStore({ projectId: '1', userListIid: '2' }), store: createStore({ projectId: '1', userListIid: '2' }),
provide: { provide: {
userListsDocsPath: '/docs/user_lists', userListsDocsPath: '/docs/user_lists',
......
import { GlAlert } from '@gitlab/ui'; import { GlAlert } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue'; import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
...@@ -12,8 +12,7 @@ import { userList } from '../../feature_flags/mock_data'; ...@@ -12,8 +12,7 @@ import { userList } from '../../feature_flags/mock_data';
jest.mock('~/api'); jest.mock('~/api');
jest.mock('~/lib/utils/url_utility'); jest.mock('~/lib/utils/url_utility');
const localVue = createLocalVue(Vue); Vue.use(Vuex);
localVue.use(Vuex);
describe('user_lists/components/new_user_list', () => { describe('user_lists/components/new_user_list', () => {
let wrapper; let wrapper;
...@@ -24,7 +23,6 @@ describe('user_lists/components/new_user_list', () => { ...@@ -24,7 +23,6 @@ describe('user_lists/components/new_user_list', () => {
beforeEach(() => { beforeEach(() => {
wrapper = mount(NewUserList, { wrapper = mount(NewUserList, {
localVue,
store: createStore({ projectId: '1' }), store: createStore({ projectId: '1' }),
provide: { provide: {
featureFlagsPath: '/feature_flags', featureFlagsPath: '/feature_flags',
......
import { GlFormCheckbox, GlLink } from '@gitlab/ui'; import { GlFormCheckbox, GlLink } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import SquashBeforeMerge from '~/vue_merge_request_widget/components/states/squash_before_merge.vue'; import SquashBeforeMerge from '~/vue_merge_request_widget/components/states/squash_before_merge.vue';
import { SQUASH_BEFORE_MERGE } from '~/vue_merge_request_widget/i18n'; import { SQUASH_BEFORE_MERGE } from '~/vue_merge_request_widget/i18n';
const localVue = createLocalVue();
describe('Squash before merge component', () => { describe('Squash before merge component', () => {
let wrapper; let wrapper;
const createComponent = (props) => { const createComponent = (props) => {
wrapper = shallowMount(localVue.extend(SquashBeforeMerge), { wrapper = shallowMount(SquashBeforeMerge, {
localVue,
propsData: { propsData: {
...props, ...props,
}, },
......
import { GlDrawer, GlInfiniteScroll } from '@gitlab/ui'; import { GlDrawer, GlInfiniteScroll } from '@gitlab/ui';
import { createLocalVue, mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper'; import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
...@@ -12,8 +13,7 @@ jest.mock('~/whats_new/utils/get_drawer_body_height', () => ({ ...@@ -12,8 +13,7 @@ jest.mock('~/whats_new/utils/get_drawer_body_height', () => ({
getDrawerBodyHeight: jest.fn().mockImplementation(() => MOCK_DRAWER_BODY_HEIGHT), getDrawerBodyHeight: jest.fn().mockImplementation(() => MOCK_DRAWER_BODY_HEIGHT),
})); }));
const localVue = createLocalVue(); Vue.use(Vuex);
localVue.use(Vuex);
describe('App', () => { describe('App', () => {
let wrapper; let wrapper;
...@@ -46,7 +46,6 @@ describe('App', () => { ...@@ -46,7 +46,6 @@ describe('App', () => {
}); });
wrapper = mount(App, { wrapper = mount(App, {
localVue,
store, store,
propsData: buildProps(), propsData: buildProps(),
directives: { directives: {
......
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