Commit f7751d32 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'slashmanov/remove-local-vue-non-ee-3' into 'master'

Remove localVue usage from non-EE tests without VueApollo (3/3)

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