Commit 449acc99 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'slashmanov/remove-local-vue-from-graphql' into 'master'

Remove localVue usage from tests with GraphQL mocks

See merge request gitlab-org/gitlab!79005
parents b888c51d 54d8e51b
import { GlButton } 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 VueApollo from 'vue-apollo';
import Vuex from 'vuex';
import AssigneeSelect from 'ee/boards/components/assignee_select.vue';
......@@ -17,8 +18,7 @@ import searchProjectUsersQuery from '~/graphql_shared/queries/users_search.query
import { ASSIGNEES_DEBOUNCE_DELAY } from '~/sidebar/constants';
import DropdownWidget from '~/vue_shared/components/dropdown/dropdown_widget/dropdown_widget.vue';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Assignee select component', () => {
let wrapper;
......@@ -51,7 +51,6 @@ describe('Assignee select component', () => {
[searchGroupUsersQuery, groupUsersQueryHandlerSuccess],
]);
wrapper = shallowMount(AssigneeSelect, {
localVue,
store,
apolloProvider: fakeApollo,
propsData: {
......
import { GlButton, GlDropdown, GlDropdownItem } 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 VueApollo from 'vue-apollo';
import Vuex from 'vuex';
import LabelsSelect from 'ee/boards/components/labels_select.vue';
......@@ -21,8 +22,7 @@ import searchProjectLabels from '~/vue_shared/components/sidebar/labels_select_w
import DropdownValue from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_value.vue';
import DropdownWidget from '~/vue_shared/components/dropdown/dropdown_widget/dropdown_widget.vue';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Labels select component', () => {
let wrapper;
......@@ -64,7 +64,6 @@ describe('Labels select component', () => {
[searchGroupLabels, groupLabelsQueryHandlerSuccess],
]);
wrapper = shallowMount(LabelsSelect, {
localVue,
store,
apolloProvider: fakeApollo,
propsData: {
......
import { GlButton, GlDropdown, GlDropdownItem } 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 VueApollo from 'vue-apollo';
import Vuex from 'vuex';
import MilestoneSelect from 'ee/boards/components/milestone_select.vue';
......@@ -20,8 +21,7 @@ import groupMilestonesQuery from '~/sidebar/queries/group_milestones.query.graph
import projectMilestonesQuery from '~/sidebar/queries/project_milestones.query.graphql';
import DropdownWidget from '~/vue_shared/components/dropdown/dropdown_widget/dropdown_widget.vue';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Milestone select component', () => {
let wrapper;
......@@ -54,7 +54,6 @@ describe('Milestone select component', () => {
[groupMilestonesQuery, groupUsersQueryHandlerSuccess],
]);
wrapper = shallowMount(MilestoneSelect, {
localVue,
store,
apolloProvider: fakeApollo,
propsData: {
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import CiMinutesUsageApp from 'ee/ci_minutes_usage/components/app.vue';
import MinutesUsageMonthChart from 'ee/ci_minutes_usage/components/minutes_usage_month_chart.vue';
......@@ -7,8 +8,7 @@ import ciMinutesUsage from 'ee/ci_minutes_usage/graphql/queries/ci_minutes.graph
import createMockApollo from 'helpers/mock_apollo_helper';
import { ciMinutesUsageMockData } from '../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('CI minutes usage app', () => {
let wrapper;
......@@ -23,7 +23,6 @@ describe('CI minutes usage app', () => {
const { fakeApollo } = options;
return shallowMount(CiMinutesUsageApp, {
localVue,
apolloProvider: fakeApollo,
});
}
......
import { GlInfiniteScroll } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import waitForPromises from 'helpers/wait_for_promises';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -7,8 +8,7 @@ import CodequalityReportApp from 'ee/codequality_report/codequality_report_graph
import getCodeQualityViolations from 'ee/codequality_report/graphql/queries/get_code_quality_violations.query.graphql';
import { mockGetCodeQualityViolationsResponse, codeQualityViolations } from './mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Codequality report app', () => {
let wrapper;
......@@ -20,7 +20,6 @@ describe('Codequality report app', () => {
const apolloProvider = createMockApollo([[getCodeQualityViolations, mockReturnValue]]);
wrapper = mountFn(CodequalityReportApp, {
localVue,
apolloProvider,
provide: {
projectPath: 'project-path',
......
import { GlLoadingIcon } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
......@@ -16,8 +17,7 @@ import {
const fullPath = 'gitlab-org/gitlab';
const iid = '315';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
jest.mock('~/flash');
......@@ -53,7 +53,6 @@ describe('Commit box pipeline mini graph', () => {
iid,
dataMethod: 'graphql',
},
localVue,
apolloProvider: createMockApolloProvider(handler),
}),
);
......
import { GlModal, GlAlert, GlSprintf } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import { cloneDeep } from 'lodash';
import VueApollo from 'vue-apollo';
import DeleteEscalationPolicyModal, {
......@@ -20,7 +21,6 @@ import mockPolicies from './mocks/mockPolicies.json';
const projectPath = 'group/project';
const mutate = jest.fn();
const mockHideModal = jest.fn();
const localVue = createLocalVue();
describe('DeleteEscalationPolicyModal', () => {
let wrapper;
......@@ -59,7 +59,7 @@ describe('DeleteEscalationPolicyModal', () => {
function createComponentWithApollo({
destroyHandler = jest.fn().mockResolvedValue(destroyPolicyResponse),
} = {}) {
localVue.use(VueApollo);
Vue.use(VueApollo);
destroyPolicyHandler = destroyHandler;
const requestHandlers = [
......@@ -78,7 +78,6 @@ describe('DeleteEscalationPolicyModal', () => {
});
wrapper = shallowMount(DeleteEscalationPolicyModal, {
localVue,
apolloProvider: fakeApollo,
propsData: {
escalationPolicy: cachedPolicy,
......
import { GlAlert } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { shallowMount, createLocalVue, mount } from '@vue/test-utils';
import { shallowMount, mount } from '@vue/test-utils';
import Vue from 'vue';
import MockAdapter from 'axios-mock-adapter';
import VueApollo from 'vue-apollo';
......@@ -42,8 +43,6 @@ const resolvedValue = {
data: mockExternalIssues,
};
const localVue = createLocalVue();
const resolvers = {
Query: {
externalIssues: jiraIssuesResolver,
......@@ -51,7 +50,7 @@ const resolvers = {
};
function createMockApolloProvider(mockResolvers = resolvers) {
localVue.use(VueApollo);
Vue.use(VueApollo);
return createMockApollo([], mockResolvers);
}
......@@ -89,7 +88,6 @@ describe('ExternalIssuesListRoot', () => {
initialFilterParams,
},
provide,
localVue,
apolloProvider,
});
};
......@@ -183,7 +181,6 @@ describe('ExternalIssuesListRoot', () => {
initialFilterParams: {},
},
provide: mockProvide,
localVue,
apolloProvider: createMockApolloProvider(),
});
await waitForPromises();
......@@ -203,7 +200,6 @@ describe('ExternalIssuesListRoot', () => {
initialFilterParams: {},
},
provide: mockProvide,
localVue,
apolloProvider: createMockApolloProvider(),
});
await waitForPromises();
......
import * as Sentry from '@sentry/browser';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import CreateForm from 'ee/groups/settings/compliance_frameworks/components/create_form.vue';
......@@ -13,8 +14,7 @@ import { visitUrl } from '~/lib/utils/url_utility';
import { validCreateResponse, errorCreateResponse } from '../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
jest.mock('~/lib/utils/url_utility');
......@@ -38,14 +38,13 @@ describe('CreateForm', () => {
const findFormStatus = () => wrapper.findComponent(FormStatus);
function createMockApolloProvider(requestHandlers) {
localVue.use(VueApollo);
Vue.use(VueApollo);
return createMockApollo(requestHandlers);
}
function createComponent(requestHandlers = []) {
return shallowMount(CreateForm, {
localVue,
apolloProvider: createMockApolloProvider(requestHandlers),
propsData,
});
......
import { GlSprintf, GlModal } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import DeleteModal from 'ee/groups/settings/compliance_frameworks/components/delete_modal.vue';
......@@ -15,8 +16,7 @@ import {
frameworkFoundResponse,
} from '../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('DeleteModal', () => {
let wrapper;
......@@ -31,7 +31,7 @@ describe('DeleteModal', () => {
const clickDeleteFramework = () => findModal().vm.$emit('primary');
function createMockApolloProvider(resolverMock) {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [
[getComplianceFrameworkQuery, fetchSuccess],
......@@ -43,7 +43,6 @@ describe('DeleteModal', () => {
const createComponent = (resolverMock) => {
wrapper = shallowMount(DeleteModal, {
localVue,
apolloProvider: createMockApolloProvider(resolverMock),
propsData: {
name: frameworkFoundResponse.name,
......
import * as Sentry from '@sentry/browser';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import EditForm from 'ee/groups/settings/compliance_frameworks/components/edit_form.vue';
......@@ -20,8 +21,7 @@ import {
errorUpdateResponse,
} from '../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
jest.mock('~/lib/utils/url_utility');
......@@ -51,14 +51,13 @@ describe('EditForm', () => {
const findFormStatus = () => wrapper.findComponent(FormStatus);
function createMockApolloProvider(requestHandlers) {
localVue.use(VueApollo);
Vue.use(VueApollo);
return createMockApollo(requestHandlers);
}
function createComponent(requestHandlers = []) {
return shallowMount(EditForm, {
localVue,
apolloProvider: createMockApolloProvider(requestHandlers),
propsData,
});
......
import { GlAlert, GlButton, GlLoadingIcon } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import DeleteModal from 'ee/groups/settings/compliance_frameworks/components/delete_modal.vue';
......@@ -14,8 +15,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
import { validFetchResponse, emptyFetchResponse } from '../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('List', () => {
let wrapper;
......@@ -34,7 +34,7 @@ describe('List', () => {
const findListItems = () => wrapper.findAllComponents(ListItem);
function createMockApolloProvider(resolverMock) {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [[getComplianceFrameworkQuery, resolverMock]];
......@@ -43,7 +43,6 @@ describe('List', () => {
function createComponentWithApollo(resolverMock, props = {}) {
return shallowMount(List, {
localVue,
apolloProvider: createMockApolloProvider(resolverMock),
propsData: {
addFrameworkPath: 'group/framework/new',
......
import { GlButton, GlModal } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { sprintf } from '~/locale';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
......@@ -16,8 +16,7 @@ import {
import * as SubscriptionsApi from 'ee/api/subscriptions_api';
import { formData, states, countries } from './mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('HandRaiseLeadButton', () => {
let wrapper;
......@@ -38,7 +37,6 @@ describe('HandRaiseLeadButton', () => {
fakeApollo = createMockApollo([], mockResolvers);
return shallowMountExtended(HandRaiseLeadButton, {
localVue,
apolloProvider: fakeApollo,
provide: {
user: {
......
import { GlDropdown, GlInfiniteScroll, GlModal, GlSkeletonLoader } from '@gitlab/ui';
import { createLocalVue, RouterLinkStub } from '@vue/test-utils';
import { nextTick } from 'vue';
import { RouterLinkStub } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import IterationCadenceListItem from 'ee/iterations/components/iteration_cadence_list_item.vue';
import TimeboxStatusBadge from 'ee/iterations/components/timebox_status_badge.vue';
......@@ -18,10 +19,8 @@ const $router = {
push,
};
const localVue = createLocalVue();
function createMockApolloProvider(requestHandlers) {
localVue.use(VueApollo);
Vue.use(VueApollo);
return createMockApollo(requestHandlers);
}
......@@ -99,7 +98,6 @@ describe('Iteration cadence list item', () => {
apolloProvider = createMockApolloProvider([[query, resolverMock]]);
wrapper = mount(IterationCadenceListItem, {
localVue,
apolloProvider,
mocks: {
$router: {
......
import { GlKeysetPagination, GlLoadingIcon } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import IterationCadenceListItem from 'ee/iterations/components/iteration_cadence_list_item.vue';
import IterationCadencesList from 'ee/iterations/components/iteration_cadences_list.vue';
......@@ -14,13 +13,11 @@ import { TEST_HOST } from 'helpers/test_constants';
import { mountExtended as mount } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises';
const localVue = createLocalVue();
const baseUrl = '/cadences/';
const router = createRouter(baseUrl);
function createMockApolloProvider(requestHandlers) {
localVue.use(VueApollo);
Vue.use(VueApollo);
return createMockApollo(requestHandlers);
}
......@@ -104,7 +101,6 @@ describe('Iteration cadences list', () => {
]);
wrapper = mount(IterationCadencesList, {
localVue,
apolloProvider,
router,
provide: {
......
import { GlDropdown, GlEmptyState, GlLoadingIcon, GlTab, GlTabs } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import IterationReport from 'ee/iterations/components/iteration_report.vue';
import IterationReportTabs from 'ee/iterations/components/iteration_report_tabs.vue';
......@@ -12,7 +13,6 @@ import waitForPromises from 'helpers/wait_for_promises';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { mockIterationNode, mockGroupIterations, mockProjectIterations } from '../mock_data';
const localVue = createLocalVue();
const $router = {
push: jest.fn(),
currentRoute: {
......@@ -50,14 +50,13 @@ describe('Iterations report', () => {
deleteMutationResponse = { data: { iterationDelete: { errors: [] } } },
deleteMutationMock = jest.fn().mockResolvedValue(deleteMutationResponse),
} = {}) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
mockApollo = createMockApollo([
[query, iterationQueryHandler],
[deleteIteration, deleteMutationMock],
]);
wrapper = shallowMount(IterationReport, {
localVue,
apolloProvider: mockApollo,
propsData: props,
provide: {
......
import { nextTick } from 'vue';
import Vue, { nextTick } from 'vue';
import { GlTab, GlTable, GlAlert } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import VueApollo from 'vue-apollo';
import { cloneDeep, merge } from 'lodash';
import allPipelinesWithPipelinesMock from 'test_fixtures/graphql/on_demand_scans/graphql/on_demand_scans.query.graphql.with_pipelines.json';
......@@ -23,8 +22,7 @@ import { PROJECT_ON_DEMAND_SCAN_COUNTS_ETAG_MOCK } from '../../mocks';
jest.mock('~/lib/utils/common_utils');
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const [firstPipeline] = allPipelinesWithPipelinesMock.data.project.pipelines.nodes;
......@@ -76,7 +74,6 @@ describe('BaseTab', () => {
BaseTab,
merge(
{
localVue,
apolloProvider: createMockApolloProvider(),
router,
propsData: {
......
import { GlButton, GlCard, GlIcon, GlCollapse } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import mockTimezones from 'test_fixtures/timezones/full.json';
import OnCallSchedule, { i18n } from 'ee/oncall_schedules/components/oncall_schedule.vue';
......@@ -16,8 +16,7 @@ import waitForPromises from 'helpers/wait_for_promises';
import * as dateTimeUtility from '~/lib/utils/datetime/date_calculation_utility';
import { getOncallSchedulesQueryResponse } from './mocks/apollo_mock';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('On-call schedule', () => {
let wrapper;
......@@ -56,7 +55,6 @@ describe('On-call schedule', () => {
]);
wrapper = shallowMountExtended(OnCallSchedule, {
localVue,
apolloProvider: fakeApollo,
propsData: {
schedule,
......
import { GlEmptyState, GlLoadingIcon, GlSprintf, GlLink } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import AddScheduleModal from 'ee/oncall_schedules/components/add_edit_schedule_modal.vue';
import OnCallSchedule from 'ee/oncall_schedules/components/oncall_schedule.vue';
......@@ -14,8 +15,6 @@ import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import { preExistingSchedule, newlyCreatedSchedule } from './mocks/apollo_mock';
const localVue = createLocalVue();
describe('On-call schedule wrapper', () => {
let wrapper;
const emptyOncallSchedulesSvgPath = 'illustration/path.svg';
......@@ -60,10 +59,9 @@ describe('On-call schedule wrapper', () => {
const fakeApollo = createMockApollo([
[getOncallSchedulesWithRotationsQuery, getOncallSchedulesQuerySpy],
]);
localVue.use(VueApollo);
Vue.use(VueApollo);
wrapper = shallowMount(OnCallScheduleWrapper, {
localVue,
apolloProvider: fakeApollo,
data() {
return {
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import waitForPromises from 'helpers/wait_for_promises';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -6,8 +7,7 @@ import PipelineEditorMiniGraph from '~/pipeline_editor/components/header/pipelin
import getLinkedPipelinesQuery from '~/projects/commit_box/info/graphql/queries/get_linked_pipelines.query.graphql';
import { mockLinkedPipelines, mockProjectFullPath, mockProjectPipeline } from '../../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Pipeline Status', () => {
let wrapper;
......@@ -34,7 +34,6 @@ describe('Pipeline Status', () => {
createComponent({
hasStages,
options: {
localVue,
apolloProvider: mockApollo,
},
});
......
import { GlSkeletonLoader } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import mockProjectQualityResponse from 'test_fixtures/graphql/project_quality_summary/graphql/queries/get_project_quality.query.graphql.json';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -12,8 +12,7 @@ import getProjectQuality from 'ee/project_quality_summary/graphql/queries/get_pr
jest.mock('~/flash');
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Project quality summary app component', () => {
let wrapper;
......@@ -32,7 +31,6 @@ describe('Project quality summary app component', () => {
const apolloProvider = createMockApollo([[getProjectQuality, mockReturnValue]]);
wrapper = mountExtended(ProjectQualitySummary, {
localVue,
apolloProvider,
provide: {
projectPath: 'project-path',
......
import { GlLink } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -11,10 +12,8 @@ import { codeOwnerMock, codeOwnersDataMock, refMock } from '../mock_data';
let wrapper;
let mockResolver;
const localVue = createLocalVue();
const createComponent = async (codeOwners = [codeOwnerMock]) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
const project = {
...codeOwnersDataMock,
......@@ -29,7 +28,6 @@ const createComponent = async (codeOwners = [codeOwnerMock]) => {
wrapper = extendedWrapper(
shallowMount(CodeOwners, {
localVue,
apolloProvider: createMockApollo([[codeOwnersInfoQuery, mockResolver]]),
propsData: { projectPath: 'some/project', filePath: 'some/file' },
mixins: [{ data: () => ({ ref: refMock }) }],
......
import { GlButton, GlModal } 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 VueApollo from 'vue-apollo';
import LockButton from 'ee_component/repository/components/lock_button.vue';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -15,17 +16,15 @@ const DEFAULT_PROPS = {
};
describe('LockButton component', () => {
const localVue = createLocalVue();
let wrapper;
const createMockApolloProvider = (resolverMock) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
return createMockApollo([[lockPathMutation, resolverMock]]);
};
const createComponent = (props = {}, lockMutation = jest.fn()) => {
wrapper = shallowMount(LockButton, {
localVue,
apolloProvider: createMockApolloProvider(lockMutation),
propsData: {
...DEFAULT_PROPS,
......
import Vue from 'vue';
import { GlForm } from '@gitlab/ui';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import { mountExtended } from 'helpers/vue_test_utils_helper';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises';
import { runnerData } from 'jest/runner/mock_data';
import { createAlert, VARIANT_SUCCESS } from '~/flash';
......@@ -34,13 +35,15 @@ describe('RunnerUpdateForm', () => {
const submitFormAndWait = () => submitForm().then(waitForPromises);
const createComponent = ({ props } = {}) => {
wrapper = mountExtended(RunnerUpdateForm, {
propsData: {
runner: mockRunner,
...props,
},
apolloProvider: createMockApollo([[runnerUpdateMutation, runnerUpdateHandler]]),
});
wrapper = extendedWrapper(
mount(RunnerUpdateForm, {
propsData: {
runner: mockRunner,
...props,
},
apolloProvider: createMockApollo([[runnerUpdateMutation, runnerUpdateHandler]]),
}),
);
};
const expectToHaveSubmittedRunnerContaining = (submittedRunner) => {
......
import { GlAlert, GlForm, GlModal } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import merge from 'lodash/merge';
import VueApollo from 'vue-apollo';
import BaseDastProfileForm from 'ee/security_configuration/dast_profiles/components/base_dast_profile_form.vue';
......@@ -9,8 +9,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const mutationVariables = {
foo: 'bar',
......@@ -52,7 +51,6 @@ describe('BaseDastProfileForm', () => {
},
options,
{
localVue,
apolloProvider,
},
);
......
import { GlAlert } from '@gitlab/ui';
import { within } from '@testing-library/dom';
import { mount, shallowMount, createLocalVue } from '@vue/test-utils';
import { mount, shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import { merge } from 'lodash';
import VueApollo from 'vue-apollo';
import DastFailedSiteValidations from 'ee/security_configuration/dast_profiles/components/dast_failed_site_validations.vue';
......@@ -21,14 +22,12 @@ const GlModal = {
},
};
const localVue = createLocalVue();
describe('EE - DastFailedSiteValidations', () => {
let wrapper;
let requestHandlers;
const createMockApolloProvider = (handlers) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
requestHandlers = handlers;
return createApolloProvider([
[dastFailedSiteValidationsQuery, requestHandlers.dastFailedSiteValidations],
......@@ -47,7 +46,6 @@ describe('EE - DastFailedSiteValidations', () => {
merge(
{
propsData: defaultProps,
localVue,
apolloProvider: createMockApolloProvider(handlers),
stubs: {
GlModal,
......
import { within, fireEvent } from '@testing-library/dom';
import { mount, shallowMount, createLocalVue } from '@vue/test-utils';
import { mount, shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import { merge } from 'lodash';
import VueApollo from 'vue-apollo';
import ProfilesList from 'ee/security_configuration/dast_profiles/components/dast_profiles_list.vue';
......@@ -20,7 +21,6 @@ jest.mock('ee/security_configuration/dast_profiles/graphql/cache_utils', () => (
}));
describe('EE - DastSiteProfileList', () => {
let localVue;
let wrapper;
let requestHandlers;
let apolloProvider;
......@@ -39,13 +39,12 @@ describe('EE - DastSiteProfileList', () => {
};
const createMockApolloProvider = (handlers) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
requestHandlers = handlers;
return createApolloProvider([[dastSiteValidationsQuery, requestHandlers.dastSiteValidations]]);
};
const wrapperFactory = (mountFn = shallowMount) => (options = {}, handlers) => {
localVue = createLocalVue();
apolloProvider = handlers && createMockApolloProvider(handlers);
wrapper = mountFn(
Component,
......@@ -53,7 +52,7 @@ describe('EE - DastSiteProfileList', () => {
{
propsData: defaultProps,
},
{ ...options, localVue, apolloProvider },
{ ...options, apolloProvider },
),
);
};
......
import { GlAlert, GlFormGroup, GlModal, GlSkeletonLoader } from '@gitlab/ui';
import { within } from '@testing-library/dom';
import { createLocalVue, mount, shallowMount, createWrapper } from '@vue/test-utils';
import { mount, shallowMount, createWrapper } from '@vue/test-utils';
import Vue from 'vue';
import merge from 'lodash/merge';
import VueApollo from 'vue-apollo';
import DastSiteValidationModal from 'ee/security_configuration/dast_site_validation/components/dast_site_validation_modal.vue';
......@@ -14,8 +15,7 @@ import * as responses from '../mock_data/apollo_mock';
jest.mock('~/lib/utils/downloader');
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const fullPath = 'group/project';
const targetUrl = 'https://example.com/';
......@@ -60,7 +60,6 @@ describe('DastSiteValidationModal', () => {
},
mountOptions,
{
localVue,
apolloProvider: createApolloProvider([
[dastSiteTokenCreateMutation, requestHandlers.dastSiteTokenCreate],
[dastSiteValidationCreateMutation, requestHandlers.dastSiteValidationCreate],
......
import { GlBadge, GlLoadingIcon } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import ProjectList from 'ee/security_dashboard/components/instance/project_list.vue';
import projectsQuery from 'ee/security_dashboard/graphql/queries/instance_projects.query.graphql';
......@@ -8,8 +9,7 @@ import waitForPromises from 'helpers/wait_for_promises';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import ProjectAvatar from '~/vue_shared/components/deprecated_project_avatar/default.vue';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const generateMockProjects = (count) => {
const projects = [];
......@@ -43,7 +43,6 @@ describe('Project List component', () => {
wrapper = extendedWrapper(
shallowMount(ProjectList, {
localVue,
apolloProvider: createMockApollo([[projectsQuery, jest.fn().mockResolvedValue(mockData)]]),
}),
);
......
import { GlAlert, GlIntersectionObserver, GlLoadingIcon } 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 VueApollo from 'vue-apollo';
import PipelineFindings from 'ee/security_dashboard/components/pipeline/pipeline_findings.vue';
import FindingModal from 'ee/security_dashboard/components/pipeline/vulnerability_finding_modal.vue';
......@@ -18,14 +19,11 @@ describe('Pipeline findings', () => {
};
const createWrapper = ({ props = {}, mocks, apolloProvider } = {}) => {
const localVue = createLocalVue();
if (apolloProvider) {
localVue.use(VueApollo);
Vue.use(VueApollo);
}
wrapper = shallowMount(PipelineFindings, {
localVue,
apolloProvider,
provide: {
projectFullPath: 'gitlab/security-reports',
......
import { GlEmptyState } 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 VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -17,8 +18,7 @@ import {
pipelineSecurityReportSummaryEmpty,
} from './mock_data';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
const dashboardDocumentation = '/help/docs';
const emptyStateSvgPath = '/svgs/empty/svg';
......@@ -62,7 +62,6 @@ describe('Pipeline Security Dashboard component', () => {
jest.spyOn(store, 'dispatch').mockImplementation();
wrapper = shallowMount(PipelineSecurityDashboard, {
localVue,
apolloProvider,
store,
provide: {
......@@ -85,7 +84,7 @@ describe('Pipeline Security Dashboard component', () => {
};
const factoryWithApollo = ({ requestHandlers }) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
factory({ apolloProvider: createMockApollo(requestHandlers) });
};
......
import { GlLoadingIcon } from '@gitlab/ui';
import { GlLineChart } from '@gitlab/ui/dist/charts';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import ProjectSecurityDashboard from 'ee/security_dashboard/components/project/project_security_dashboard.vue';
import ReportNotConfigured from 'ee/security_dashboard/components/shared/empty_states/report_not_configured_project.vue';
......@@ -14,8 +15,7 @@ import {
mockProjectSecurityChartsWithoutData,
} from '../../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
jest.mock('~/lib/utils/icon_utils', () => ({
getSvgIconPathContent: jest.fn().mockResolvedValue('mockSvgPathContent'),
......@@ -43,7 +43,6 @@ describe('Project Security Dashboard component', () => {
secureVulnerabilityTrainingEnabled = true,
}) => {
const component = shallowMount(ProjectSecurityDashboard, {
localVue,
apolloProvider: createApolloProvider([
projectsHistoryQuery,
jest.fn().mockResolvedValue(query),
......
import { nextTick } from 'vue';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import { shallowMount } from '@vue/test-utils';
import VueApollo from 'vue-apollo';
import Cookies from 'js-cookie';
import VueRouter from 'vue-router';
......@@ -18,9 +19,8 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
import { SCANNER_NAMES_MAP } from '~/security_configuration/components/constants';
const localVue = createLocalVue();
localVue.use(VueApollo);
localVue.use(VueRouter);
Vue.use(VueApollo);
Vue.use(VueRouter);
const router = new VueRouter();
describe('Project vulnerability report app component', () => {
......@@ -45,7 +45,6 @@ describe('Project vulnerability report app component', () => {
secureVulnerabilityTraining = true,
} = {}) => {
wrapper = shallowMount(ProjectVulnerabilityReport, {
localVue,
router,
apolloProvider: createMockApollo([
[securityScannersQuery, securityScannersHandler(securityScanners)],
......
import { GlLink, GlLoadingIcon } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import VulnerabilitySeverity from 'ee/security_dashboard/components/shared/project_security_status_chart.vue';
import groupVulnerabilityGradesQuery from 'ee/security_dashboard/graphql/queries/group_vulnerability_grades.query.graphql';
......@@ -15,8 +16,7 @@ import {
mockGroupVulnerabilityGrades,
} from '../../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Vulnerability Severity component', () => {
let wrapper;
......@@ -31,7 +31,6 @@ describe('Vulnerability Severity component', () => {
const createComponent = ({ provide, query, mockData } = {}) => {
return shallowMount(VulnerabilitySeverity, {
localVue,
apolloProvider: createMockApollo([[query, jest.fn().mockResolvedValue(mockData)]]),
propsData: {
query,
......
import { GlAlert } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import SelectionSummary from 'ee/security_dashboard/components/shared/selection_summary.vue';
import StatusDropdown from 'ee/security_dashboard/components/shared/status_dropdown.vue';
......@@ -11,8 +12,7 @@ import toast from '~/vue_shared/plugins/global_toast';
jest.mock('~/vue_shared/plugins/global_toast');
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Selection Summary component', () => {
let wrapper;
......@@ -29,7 +29,6 @@ describe('Selection Summary component', () => {
const createComponent = ({ props = {}, apolloProvider } = {}) => {
wrapper = shallowMount(SelectionSummary, {
localVue,
apolloProvider,
stubs: {
GlAlert,
......
import { GlCard, GlSkeletonLoading } from '@gitlab/ui';
import { nextTick } from 'vue';
import { createLocalVue } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import VulnerabilityCounts from 'ee/security_dashboard/components/shared/vulnerability_report/vulnerability_counts.vue';
import { mountExtended } from 'helpers/vue_test_utils_helper';
......@@ -13,8 +13,7 @@ import { SEVERITIES } from '~/vulnerabilities/constants';
jest.mock('~/flash');
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const fullPath = 'path';
const counts = { critical: 1, high: 2, medium: 5, low: 4, info: 3, unknown: 6 };
......@@ -44,7 +43,6 @@ describe('Vulnerability counts component', () => {
countsHandler = defaultCountsRequestHandler,
} = {}) => {
wrapper = mountExtended(VulnerabilityCounts, {
localVue,
apolloProvider: createMockApollo([[countsQuery, countsHandler]]),
provide: {
fullPath,
......
import { createLocalVue } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import { nextTick } from 'vue';
import { GlIntersectionObserver } from '@gitlab/ui';
import VulnerabilityListGraphql from 'ee/security_dashboard/components/shared/vulnerability_report/vulnerability_list_graphql.vue';
import VulnerabilityList from 'ee/security_dashboard/components/shared/vulnerability_report/vulnerability_list.vue';
......@@ -12,8 +12,7 @@ import createFlash from '~/flash';
jest.mock('~/flash');
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const fullPath = 'path';
const portalName = 'portal-name';
......@@ -45,7 +44,6 @@ describe('Vulnerability list GraphQL component', () => {
fields = [],
} = {}) => {
wrapper = shallowMountExtended(VulnerabilityListGraphql, {
localVue,
apolloProvider: createMockApollo([[vulnerabilitiesQuery, vulnerabilitiesHandler]]),
provide: {
fullPath,
......
......@@ -6,15 +6,14 @@ import {
GlDropdownSectionHeader,
GlSearchBoxByType,
} from '@gitlab/ui';
import { mount, shallowMount, createLocalVue } from '@vue/test-utils';
import { mount, shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import IterationDropdown from 'ee/sidebar/components/iteration_dropdown.vue';
import groupIterationsQuery from 'ee/sidebar/queries/iterations.query.graphql';
import createMockApollo from 'helpers/mock_apollo_helper';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const TEST_SEARCH = 'search';
const TEST_FULL_PATH = 'gitlab-test/test';
......@@ -112,7 +111,6 @@ describe('IterationDropdown', () => {
fakeApollo = createMockApollo([[groupIterationsQuery, groupIterationsSpy]]);
wrapper = mountFn(IterationDropdown, {
localVue,
apolloProvider: fakeApollo,
propsData: {
fullPath: TEST_FULL_PATH,
......
......@@ -6,7 +6,8 @@ import {
GlFormInput,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { createLocalVue, mount } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import SidebarDropdownWidget from 'ee/sidebar/components/sidebar_dropdown_widget.vue';
......@@ -32,8 +33,6 @@ import {
jest.mock('~/flash');
const localVue = createLocalVue();
describe('SidebarDropdownWidget', () => {
let wrapper;
let mockApollo;
......@@ -89,7 +88,7 @@ describe('SidebarDropdownWidget', () => {
groupEpicsSpy = jest.fn().mockResolvedValue(mockGroupEpicsResponse),
currentEpicSpy = jest.fn().mockResolvedValue(noCurrentEpicResponse),
} = {}) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
mockApollo = createMockApollo([
[groupEpicsQuery, groupEpicsSpy],
[projectIssueEpicQuery, currentEpicSpy],
......@@ -98,7 +97,6 @@ describe('SidebarDropdownWidget', () => {
wrapper = extendedWrapper(
mount(SidebarDropdownWidget, {
localVue,
provide: { canUpdate: true, issuableAttributesQueries },
apolloProvider: mockApollo,
propsData: {
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import SidebarStatus from 'ee/sidebar/components/status/sidebar_status.vue';
import Status from 'ee/sidebar/components/status/status.vue';
......@@ -6,8 +7,7 @@ import { healthStatusQueries } from 'ee/sidebar/constants';
import createMockApollo from 'helpers/mock_apollo_helper';
import { getHealthStatusMutationResponse, getHealthStatusQueryResponse } from './mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const createQueryHandler = ({ state, healthStatus }) =>
jest.fn().mockResolvedValue(getHealthStatusQueryResponse({ state, healthStatus }));
......@@ -35,7 +35,6 @@ describe('SidebarStatus', () => {
healthStatus = 'onTrack',
} = {}) => {
wrapper = shallowMount(SidebarStatus, {
localVue,
propsData: {
issuableType,
iid: '1',
......
import { GlEmptyState, GlAlert } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { pick } from 'lodash';
import {
......@@ -18,15 +18,13 @@ import waitForPromises from 'helpers/wait_for_promises';
import { createMockApolloProvider } from 'ee_jest/subscriptions/spec_helper';
import { mockCiMinutesPlans, mockStoragePlans } from 'ee_jest/subscriptions/mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Buy Addons Shared App', () => {
let wrapper;
async function createComponent(apolloProvider, injectedProps) {
wrapper = shallowMountExtended(App, {
localVue,
apolloProvider,
provide: injectedProps,
stubs: {
......
import { GlAlert } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import { merge } from 'lodash';
import VueApollo from 'vue-apollo';
import { stateData as initialStateData } from 'ee_jest/subscriptions/mock_data';
......@@ -11,8 +11,7 @@ import purchaseFlowResolvers from 'ee/vue_shared/purchase_flow/graphql/resolvers
import createMockApollo from 'helpers/mock_apollo_helper';
import { mountExtended } from 'helpers/vue_test_utils_helper';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('AddonPurchaseDetails', () => {
const resolvers = { ...purchaseFlowResolvers, ...subscriptionsResolvers };
......@@ -31,7 +30,6 @@ describe('AddonPurchaseDetails', () => {
const createComponent = (stateData = {}, props = {}) => {
const apolloProvider = createMockApolloProvider(stateData);
wrapper = mountExtended(AddonPurchaseDetails, {
localVue,
apolloProvider,
stubs: {
Step,
......
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import { merge } from 'lodash';
import VueApollo from 'vue-apollo';
import BillingAddress from 'ee/vue_shared/purchase_flow/components/checkout/billing_address.vue';
......@@ -19,8 +19,7 @@ import flushPromises from 'helpers/flush_promises';
jest.mock('~/flash');
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Checkout', () => {
let wrapper;
......@@ -52,7 +51,6 @@ describe('Checkout', () => {
const createComponent = (stateData = {}) => {
const apolloProvider = createMockApolloProvider(stateData);
wrapper = shallowMountExtended(Checkout, {
localVue,
apolloProvider,
propsData: {
plan,
......
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import { merge } from 'lodash';
import VueApollo from 'vue-apollo';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
......@@ -17,8 +17,7 @@ import waitForPromises from 'helpers/wait_for_promises';
import orderPreviewQuery from 'ee/subscriptions/graphql/queries/order_preview.customer.query.graphql';
import { CUSTOMERSDOT_CLIENT, I18N_API_ERROR } from 'ee/subscriptions/buy_addons_shared/constants';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Order Summary', () => {
const resolvers = { ...purchaseFlowResolvers, ...subscriptionsResolvers };
......@@ -46,7 +45,6 @@ describe('Order Summary', () => {
const createComponent = (apolloProvider, props) => {
wrapper = shallowMountExtended(OrderSummary, {
localVue,
apolloProvider,
propsData: {
plan: mockStoragePlans[0],
......
import { mount, createLocalVue } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import { merge } from 'lodash';
import VueApollo from 'vue-apollo';
import { gitLabResolvers } from 'ee/subscriptions/buy_addons_shared/graphql/resolvers';
......@@ -10,8 +11,7 @@ import { stateData as initialStateData } from 'ee_jest/subscriptions/mock_data';
import { createMockApolloProvider } from 'ee_jest/vue_shared/purchase_flow/spec_helper';
import waitForPromises from 'helpers/wait_for_promises';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Billing Address', () => {
let wrapper;
......@@ -37,7 +37,6 @@ describe('Billing Address', () => {
});
return mount(BillingAddress, {
localVue,
apolloProvider,
});
};
......
import { GlButton, GlLoadingIcon } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import Api from 'ee/api';
import { STEPS } from 'ee/subscriptions/constants';
......@@ -25,12 +26,10 @@ describe('Confirm Order', () => {
const findConfirmButton = () => wrapper.findComponent(GlButton);
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const createComponent = (options = {}) => {
wrapper = extendedWrapper(
shallowMount(ConfirmOrder, {
localVue,
...options,
}),
);
......
import { mount, createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue';
import { mount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import Vuex from 'vuex';
import { STEPS } from 'ee/subscriptions/constants';
......@@ -10,9 +11,8 @@ import Step from 'ee/vue_shared/purchase_flow/components/step.vue';
import activateNextStepMutation from 'ee/vue_shared/purchase_flow/graphql/mutations/activate_next_step.mutation.graphql';
import { createMockApolloProvider } from 'ee_jest/vue_shared/purchase_flow/spec_helper';
const localVue = createLocalVue();
localVue.use(Vuex);
localVue.use(VueApollo);
Vue.use(Vuex);
Vue.use(VueApollo);
describe('Billing Address', () => {
let store;
......@@ -40,7 +40,6 @@ describe('Billing Address', () => {
function createComponent(options = {}) {
return mount(BillingAddress, {
localVue,
...options,
});
}
......
import { GlButton, GlLoadingIcon } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import Vuex from 'vuex';
import Api from 'ee/api';
......@@ -13,9 +14,8 @@ import flash from '~/flash';
jest.mock('~/flash');
describe('Confirm Order', () => {
const localVue = createLocalVue();
localVue.use(Vuex);
localVue.use(VueApollo);
Vue.use(Vuex);
Vue.use(VueApollo);
let wrapper;
......@@ -25,7 +25,6 @@ describe('Confirm Order', () => {
function createComponent(options = {}) {
return shallowMount(ConfirmOrder, {
localVue,
store,
...options,
});
......
import { mount, createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue';
import { mount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import Vuex from 'vuex';
import { STEPS } from 'ee/subscriptions/constants';
......@@ -10,16 +10,14 @@ import Step from 'ee/vue_shared/purchase_flow/components/step.vue';
import { createMockApolloProvider } from 'ee_jest/vue_shared/purchase_flow/spec_helper';
describe('Payment Method', () => {
const localVue = createLocalVue();
localVue.use(Vuex);
localVue.use(VueApollo);
Vue.use(Vuex);
Vue.use(VueApollo);
let store;
let wrapper;
function createComponent(options = {}) {
return mount(PaymentMethod, {
localVue,
store,
...options,
});
......
import { mount, createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue';
import { mount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import Vuex from 'vuex';
import { STEPS } from 'ee/subscriptions/constants';
......@@ -30,16 +30,14 @@ const createDefaultInitialStoreData = (initialData) => ({
});
describe('Subscription Details', () => {
const localVue = createLocalVue();
localVue.use(Vuex);
localVue.use(VueApollo);
Vue.use(Vuex);
Vue.use(VueApollo);
let wrapper;
function createComponent(options = {}) {
const { apolloProvider, store } = options;
return mount(Component, {
localVue,
store,
apolloProvider,
stubs: {
......
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import InstanceProjectSelector from 'ee/threat_monitoring/components/instance_project_selector.vue';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -7,7 +7,6 @@ import waitForPromises from 'helpers/wait_for_promises';
import getUsersProjects from '~/graphql_shared/queries/get_users_projects.query.graphql';
import ProjectSelector from '~/vue_shared/components/project_selector/project_selector.vue';
const localVue = createLocalVue();
let querySpy;
const defaultProjectSelectorProps = {
......@@ -72,7 +71,7 @@ const mockGetUsersProjects = {
};
const createMockApolloProvider = (queryResolver) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
return createMockApollo([[getUsersProjects, queryResolver]]);
};
......@@ -83,7 +82,6 @@ describe('InstanceProjectSelector Component', () => {
const createWrapper = ({ queryResolver, propsData = {} } = {}) => {
wrapper = shallowMountExtended(InstanceProjectSelector, {
localVue,
apolloProvider: createMockApolloProvider(queryResolver),
propsData: {
...propsData,
......
import { GlTable, GlDrawer } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import { merge } from 'lodash';
import VueApollo from 'vue-apollo';
import { POLICY_TYPE_OPTIONS } from 'ee/threat_monitoring/components/constants';
......@@ -25,8 +25,7 @@ import {
mockScanResultPoliciesResponse,
} from '../../mocks/mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const fullPath = 'project/path';
const environments = [
......@@ -105,7 +104,6 @@ describe('PoliciesList component', () => {
}),
NoPoliciesEmptyState: true,
},
localVue,
},
wrapperOptions,
),
......
import { GlDropdown, GlModal, GlAlert } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import InstanceProjectSelector from 'ee/threat_monitoring/components/instance_project_selector.vue';
import ScanNewPolicyModal from 'ee/threat_monitoring/components/policies/scan_new_policy_modal.vue';
......@@ -14,8 +14,7 @@ import {
mockUnlinkSecurityPolicyProjectResponses,
} from '../../mocks/mock_apollo';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('ScanNewPolicyModal Component', () => {
let wrapper;
......@@ -49,7 +48,6 @@ describe('ScanNewPolicyModal Component', () => {
provide = {},
} = {}) => {
wrapper = mountExtended(ScanNewPolicyModal, {
localVue,
apolloProvider: createMockApollo([[mutationQuery, mutationResult]]),
stubs: {
GlModal: stubComponent(GlModal, {
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import PolicyAlertPicker from 'ee/threat_monitoring/components/policy_editor/policy_alert_picker.vue';
import getAgentCount from 'ee/threat_monitoring/graphql/queries/get_agent_count.query.graphql';
import createMockApollo from 'helpers/mock_apollo_helper';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('PolicyAlertPicker component', () => {
let wrapper;
......@@ -33,7 +33,6 @@ describe('PolicyAlertPicker component', () => {
wrapper = extendedWrapper(
shallowMount(PolicyAlertPicker, {
apolloProvider,
localVue,
propsData: {
...propsData,
},
......
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -6,8 +6,7 @@ import CountryOrRegionSelector from 'ee/trials/components/country_or_region_sele
import { countries, states } from '../../hand_raise_leads/components/mock_data';
import { formData } from './mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('CountryOrRegionSelector', () => {
let wrapper;
......@@ -25,7 +24,6 @@ describe('CountryOrRegionSelector', () => {
};
return mountFunction(CountryOrRegionSelector, {
localVue,
apolloProvider: createMockApollo([], mockResolvers),
provide: {
user: formData,
......
import { GlAlert, GlLoadingIcon } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
......@@ -15,8 +16,7 @@ import {
defaultProjectProvideValues,
} from '../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('ProjectStorageApp', () => {
let wrapper;
......@@ -38,7 +38,6 @@ describe('ProjectStorageApp', () => {
const createComponent = ({ provide = {}, mockApollo } = {}) => {
wrapper = extendedWrapper(
shallowMount(ProjectStorageApp, {
localVue,
apolloProvider: mockApollo,
provide: {
...defaultProjectProvideValues,
......
import { shallowMount, mount, createLocalVue } from '@vue/test-utils';
import { shallowMount, mount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { stubExperiments } from 'helpers/experimentation_helper';
......@@ -8,8 +9,7 @@ import HandRaiseLeadButton from 'ee/hand_raise_leads/hand_raise_lead/components/
import { mockTracking } from 'helpers/tracking_helper';
import createMockApollo from 'helpers/mock_apollo_helper';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Card security discover app', () => {
let wrapper;
......@@ -24,7 +24,6 @@ describe('Card security discover app', () => {
linkSecondary: '/link/secondary',
};
wrapper = mountFn(CardSecurityDiscoverApp, {
localVue,
propsData,
apolloProvider: createMockApollo([], {}),
provide: {
......
import { GlButton, GlBadge } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import MockAdapter from 'axios-mock-adapter';
import VueApollo from 'vue-apollo';
import Api from 'ee/api';
......@@ -23,8 +24,7 @@ import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
import download from '~/lib/utils/downloader';
import * as urlUtility from '~/lib/utils/url_utility';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const vulnerabilityStateEntries = Object.entries(VULNERABILITY_STATE_OBJECTS);
const mockAxios = new MockAdapter(axios);
......@@ -90,7 +90,6 @@ describe('Vulnerability Header', () => {
const createWrapper = ({ vulnerability = {}, apolloProvider }) => {
wrapper = shallowMount(Header, {
localVue,
apolloProvider,
propsData: {
vulnerability: {
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import fetchHeaderVulnerabilityQuery from 'ee/security_dashboard/graphql/header_vulnerability.graphql';
import FalsePositiveAlert from 'ee/vulnerabilities/components/false_positive_alert.vue';
......@@ -11,8 +12,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
import createFlash from '~/flash';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
jest.mock('~/flash');
describe('Vulnerability', () => {
......@@ -73,7 +73,6 @@ describe('Vulnerability', () => {
const createWrapper = ({ vulnData, apolloProvider } = {}) => {
wrapper = shallowMount(Main, {
localVue,
apolloProvider,
propsData: {
initialVulnerability: { ...getVulnerability(), ...vulnData },
......
import { GlLoadingIcon, GlAlert } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import AxiosMockAdapter from 'axios-mock-adapter';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createHttpIntegrationMutation from 'ee_else_ce/alerts_settings/graphql/mutations/create_http_integration.mutation.graphql';
import updateHttpIntegrationMutation from 'ee_else_ce/alerts_settings/graphql/mutations/update_http_integration.mutation.graphql';
......@@ -49,8 +50,6 @@ import mockIntegrations from './mocks/integrations.json';
jest.mock('~/flash');
const localVue = createLocalVue();
describe('AlertsSettingsWrapper', () => {
let wrapper;
let fakeApollo;
......@@ -111,7 +110,7 @@ describe('AlertsSettingsWrapper', () => {
function createComponentWithApollo({
destroyHandler = jest.fn().mockResolvedValue(destroyIntegrationResponse),
} = {}) {
localVue.use(VueApollo);
Vue.use(VueApollo);
destroyIntegrationHandler = destroyHandler;
const requestHandlers = [
......@@ -122,7 +121,6 @@ describe('AlertsSettingsWrapper', () => {
fakeApollo = createMockApollo(requestHandlers);
wrapper = mount(AlertsSettingsWrapper, {
localVue,
apolloProvider: fakeApollo,
provide: {
alertSettings: {
......
import { GlFormCheckbox, GlLink } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import UpdateKeepLatestArtifactProjectSetting from '~/artifacts_settings/graphql/mutations/update_keep_latest_artifact_project_setting.mutation.graphql';
......@@ -7,8 +8,7 @@ import GetKeepLatestArtifactApplicationSetting from '~/artifacts_settings/graphq
import GetKeepLatestArtifactProjectSetting from '~/artifacts_settings/graphql/queries/get_keep_latest_artifact_project_setting.query.graphql';
import KeepLatestArtifactCheckbox from '~/artifacts_settings/keep_latest_artifact_checkbox.vue';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const keepLatestArtifactProjectMock = {
data: {
......@@ -73,7 +73,6 @@ describe('Keep latest artifact checkbox', () => {
stubs: {
GlFormCheckbox,
},
localVue,
apolloProvider,
});
};
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import Vuex from 'vuex';
......@@ -33,9 +34,8 @@ export default function createComponent({
},
issuesCount,
} = {}) {
const localVue = createLocalVue();
localVue.use(VueApollo);
localVue.use(Vuex);
Vue.use(VueApollo);
Vue.use(Vuex);
const fakeApollo = createMockApollo([
[listQuery, jest.fn().mockResolvedValue(boardListQueryResponse(issuesCount))],
......@@ -85,7 +85,6 @@ export default function createComponent({
const component = shallowMount(BoardList, {
apolloProvider: fakeApollo,
localVue,
store,
propsData: {
disabled: false,
......
import { GlAlert, GlButton, GlFormInputGroup, GlSprintf } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { sprintf } from '~/locale';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
......@@ -32,8 +32,7 @@ import {
} from '../mocks/apollo';
import ModalStub from '../stubs';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const projectPath = 'path/to/project';
const kasAddress = 'kas.example.com';
......@@ -95,7 +94,6 @@ describe('InstallAgentModal', () => {
GlSprintf,
GlModal: ModalStub,
},
localVue,
apolloProvider,
provide,
propsData,
......
import { GlEmptyState } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo, { ApolloMutation } from 'vue-apollo';
import VueRouter from 'vue-router';
import VueDraggable from 'vuedraggable';
......@@ -49,9 +50,8 @@ jest.spyOn(utils, 'getPageLayoutElement').mockReturnValue(mockPageEl);
const scrollIntoViewMock = jest.fn();
HTMLElement.prototype.scrollIntoView = scrollIntoViewMock;
const localVue = createLocalVue();
const router = createRouter();
localVue.use(VueRouter);
Vue.use(VueRouter);
const mockDesigns = [
{
......@@ -159,7 +159,6 @@ describe('Design management index page', () => {
};
},
mocks: { $apollo },
localVue,
router,
stubs: { DesignDestroyer, ApolloMutation, VueDraggable, ...stubs },
attachTo: document.body,
......@@ -175,7 +174,7 @@ describe('Design management index page', () => {
function createComponentWithApollo({
moveHandler = jest.fn().mockResolvedValue(moveDesignMutationResponse),
}) {
localVue.use(VueApollo);
Vue.use(VueApollo);
moveDesignHandler = moveHandler;
const requestHandlers = [
......@@ -186,7 +185,6 @@ describe('Design management index page', () => {
fakeApollo = createMockApollo(requestHandlers);
wrapper = shallowMount(Index, {
localVue,
apolloProvider: fakeApollo,
router,
stubs: { VueDraggable },
......
import { GlDropdown, GlDropdownItem, GlSearchBoxByType } from '@gitlab/ui';
import { createLocalVue, mount, shallowMount } from '@vue/test-utils';
import { mount, shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -17,8 +18,7 @@ import {
describe('NewIssueDropdown component', () => {
let wrapper;
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const mountComponent = ({
search = '',
......@@ -29,7 +29,6 @@ describe('NewIssueDropdown component', () => {
const apolloProvider = createMockApollo(requestHandlers);
return mountFn(NewIssueDropdown, {
localVue,
apolloProvider,
provide: {
fullPath: 'mushroom-kingdom',
......
import { GlFormGroup, GlDropdown, GlDropdownItem, GlIcon } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -10,8 +11,7 @@ import {
updateIssueStateQueryResponse,
} from '../../mock_data/apollo_mock';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Issue type field component', () => {
let wrapper;
......@@ -43,7 +43,6 @@ describe('Issue type field component', () => {
fakeApollo = createMockApollo([], mockResolvers);
wrapper = shallowMount(IssueTypeField, {
localVue,
apolloProvider: fakeApollo,
data() {
return {
......
import { GlAlert, GlForm, GlFormInput, GlButton } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -45,8 +46,6 @@ const mockCreateBranchMutationWithErrors = jest
const mockCreateBranchMutationFailed = jest.fn().mockRejectedValue(new Error('GraphQL error'));
const mockMutationLoading = jest.fn().mockReturnValue(new Promise(() => {}));
const localVue = createLocalVue();
describe('NewBranchForm', () => {
let wrapper;
......@@ -66,7 +65,7 @@ describe('NewBranchForm', () => {
function createMockApolloProvider({
mockCreateBranchMutation = mockCreateBranchMutationSuccess,
} = {}) {
localVue.use(VueApollo);
Vue.use(VueApollo);
const mockApollo = createMockApollo([[createBranchMutation, mockCreateBranchMutation]]);
......@@ -75,7 +74,6 @@ describe('NewBranchForm', () => {
function createComponent({ mockApollo, provide } = {}) {
wrapper = shallowMount(NewBranchForm, {
localVue,
apolloProvider: mockApollo || createMockApolloProvider(),
provide: {
initialBranchName: '',
......
import { GlDropdown, GlDropdownItem, GlLoadingIcon, GlSearchBoxByType } from '@gitlab/ui';
import { mount, shallowMount, createLocalVue } from '@vue/test-utils';
import { mount, shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -7,8 +8,6 @@ import ProjectDropdown from '~/jira_connect/branches/components/project_dropdown
import { PROJECTS_PER_PAGE } from '~/jira_connect/branches/constants';
import getProjectsQuery from '~/jira_connect/branches/graphql/queries/get_projects.query.graphql';
const localVue = createLocalVue();
const mockProjects = [
{
id: 'test',
......@@ -62,7 +61,7 @@ describe('ProjectDropdown', () => {
const findSearchBox = () => wrapper.findComponent(GlSearchBoxByType);
function createMockApolloProvider({ mockGetProjectsQuery = mockGetProjectsQuerySuccess } = {}) {
localVue.use(VueApollo);
Vue.use(VueApollo);
const mockApollo = createMockApollo([[getProjectsQuery, mockGetProjectsQuery]]);
......@@ -71,7 +70,6 @@ describe('ProjectDropdown', () => {
function createComponent({ mockApollo, props, mountFn = shallowMount } = {}) {
wrapper = mountFn(ProjectDropdown, {
localVue,
apolloProvider: mockApollo || createMockApolloProvider(),
propsData: props,
});
......
import { GlDropdown, GlDropdownItem, GlLoadingIcon, GlSearchBoxByType } from '@gitlab/ui';
import { mount, shallowMount, createLocalVue } from '@vue/test-utils';
import { mount, shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -7,8 +8,6 @@ import SourceBranchDropdown from '~/jira_connect/branches/components/source_bran
import { BRANCHES_PER_PAGE } from '~/jira_connect/branches/constants';
import getProjectQuery from '~/jira_connect/branches/graphql/queries/get_project.query.graphql';
const localVue = createLocalVue();
const mockProject = {
id: 'test',
fullPath: 'test-path',
......@@ -45,7 +44,7 @@ describe('SourceBranchDropdown', () => {
};
function createMockApolloProvider({ getProjectQueryLoading = false } = {}) {
localVue.use(VueApollo);
Vue.use(VueApollo);
const mockApollo = createMockApollo([
[getProjectQuery, getProjectQueryLoading ? mockQueryLoading : mockGetProjectQuery],
......@@ -56,7 +55,6 @@ describe('SourceBranchDropdown', () => {
function createComponent({ mockApollo, props, mountFn = shallowMount } = {}) {
wrapper = mountFn(SourceBranchDropdown, {
localVue,
apolloProvider: mockApollo || createMockApolloProvider(),
propsData: props,
});
......
import { nextTick } from 'vue';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import { shallowMount } from '@vue/test-utils';
import { GlBreakpointInstance } from '@gitlab/ui/dist/utils';
import { GlLoadingIcon } from '@gitlab/ui';
import VueApollo from 'vue-apollo';
......@@ -17,9 +18,6 @@ import {
mockPipelineQueryResponse,
} from './mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
describe('Bridge Show Page', () => {
let wrapper;
let mockApollo;
......@@ -47,10 +45,10 @@ describe('Bridge Show Page', () => {
const createComponentWithApollo = () => {
const handlers = [[getPipelineQuery, mockPipelineQuery]];
Vue.use(VueApollo);
mockApollo = createMockApollo(handlers);
createComponent({
localVue,
apolloProvider: mockApollo,
mocks: {},
});
......
import { GlSkeletonLoader, GlAlert, GlEmptyState, GlPagination } from '@gitlab/ui';
import { createLocalVue, mount, shallowMount } from '@vue/test-utils';
import { mount, shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -10,8 +11,7 @@ import JobsTableTabs from '~/jobs/components/table/jobs_table_tabs.vue';
import { mockJobsQueryResponse, mockJobsQueryEmptyResponse } from '../../mock_data';
const projectPath = 'gitlab-org/gitlab';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Job table app', () => {
let wrapper;
......@@ -50,7 +50,6 @@ describe('Job table app', () => {
provide: {
projectPath,
},
localVue,
apolloProvider: createMockApolloProvider(handler),
});
};
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import { GlEmptyState } from '@gitlab/ui';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -22,8 +22,6 @@ import {
import { FILTERED_SEARCH_TERM } from '~/packages_and_registries/shared/constants';
import { tagsMock, imageTagsMock, tagsPageInfo } from '../../mock_data';
const localVue = createLocalVue();
describe('Tags List', () => {
let wrapper;
let apolloProvider;
......@@ -50,13 +48,12 @@ describe('Tags List', () => {
};
const mountComponent = ({ propsData = { isMobile: false, id: 1 } } = {}) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [[getContainerRepositoryTagsQuery, resolver]];
apolloProvider = createMockApollo(requestHandlers);
wrapper = shallowMount(component, {
localVue,
apolloProvider,
propsData,
stubs: { RegistryList },
......
import { GlKeysetPagination, GlEmptyState } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import { nextTick } from 'vue';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
import axios from '~/lib/utils/axios_utils';
......@@ -39,8 +40,6 @@ import {
} from '../mock_data';
import { DeleteModal } from '../stubs';
const localVue = createLocalVue();
describe('Details Page', () => {
let wrapper;
let apolloProvider;
......@@ -85,7 +84,7 @@ describe('Details Page', () => {
options,
config = defaultConfig,
} = {}) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [
[getContainerRepositoryDetailsQuery, resolver],
......@@ -96,7 +95,6 @@ describe('Details Page', () => {
apolloProvider = createMockApollo(requestHandlers);
wrapper = shallowMount(component, {
localVue,
apolloProvider,
stubs: {
DeleteModal,
......
import { GlSkeletonLoader, GlSprintf, GlAlert } 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 VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -38,8 +39,6 @@ import {
} from '../mock_data';
import { GlModal, GlEmptyState } from '../stubs';
const localVue = createLocalVue();
describe('List Page', () => {
let wrapper;
let apolloProvider;
......@@ -75,7 +74,7 @@ describe('List Page', () => {
config = { isGroupPage: false },
query = {},
} = {}) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [
[getContainerRepositoriesQuery, resolver],
......@@ -86,7 +85,6 @@ describe('List Page', () => {
apolloProvider = createMockApollo(requestHandlers);
wrapper = shallowMount(component, {
localVue,
apolloProvider,
stubs: {
GlModal,
......
......@@ -5,7 +5,7 @@ import {
GlSprintf,
GlEmptyState,
} from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
......@@ -21,8 +21,6 @@ import getDependencyProxyDetailsQuery from '~/packages_and_registries/dependency
import { proxyDetailsQuery, proxyData, pagination, proxyManifests } from './mock_data';
const localVue = createLocalVue();
describe('DependencyProxyApp', () => {
let wrapper;
let apolloProvider;
......@@ -35,14 +33,13 @@ describe('DependencyProxyApp', () => {
};
function createComponent({ provide = provideDefaults } = {}) {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [[getDependencyProxyDetailsQuery, resolver]];
apolloProvider = createMockApollo(requestHandlers);
wrapper = shallowMountExtended(DependencyProxyApp, {
localVue,
apolloProvider,
provide,
stubs: {
......
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import waitForPromises from 'helpers/wait_for_promises';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
......@@ -16,8 +16,6 @@ import {
jest.mock('~/flash');
const localVue = createLocalVue();
describe('DeletePackage', () => {
let wrapper;
let apolloProvider;
......@@ -27,7 +25,7 @@ describe('DeletePackage', () => {
const eventPayload = { id: '1' };
function createComponent(propsData = {}) {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [
[getPackagesQuery, resolver],
......@@ -37,7 +35,6 @@ describe('DeletePackage', () => {
wrapper = shallowMountExtended(DeletePackage, {
propsData,
localVue,
apolloProvider,
scopedSlots: {
default(props) {
......
import { GlEmptyState, GlBadge, GlTabs, GlTab } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import { useMockLocationHelper } from 'helpers/mock_window_location_helper';
......@@ -41,8 +41,6 @@ import {
jest.mock('~/flash');
useMockLocationHelper();
const localVue = createLocalVue();
describe('PackagesApp', () => {
let wrapper;
let apolloProvider;
......@@ -64,7 +62,7 @@ describe('PackagesApp', () => {
fileDeleteMutationResolver = jest.fn().mockResolvedValue(packageDestroyFileMutation()),
routeId = '1',
} = {}) {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [
[getPackageDetails, resolver],
......@@ -73,7 +71,6 @@ describe('PackagesApp', () => {
apolloProvider = createMockApollo(requestHandlers);
wrapper = shallowMountExtended(PackagesApp, {
localVue,
apolloProvider,
provide,
stubs: {
......
import { GlEmptyState, GlSprintf, GlLink } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import { nextTick } from 'vue';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -27,8 +27,6 @@ import { packagesListQuery, packageData, pagination } from '../mock_data';
jest.mock('~/lib/utils/common_utils');
jest.mock('~/flash');
const localVue = createLocalVue();
describe('PackagesListApp', () => {
let wrapper;
let apolloProvider;
......@@ -61,13 +59,12 @@ describe('PackagesListApp', () => {
resolver = jest.fn().mockResolvedValue(packagesListQuery()),
provide = defaultProvide,
} = {}) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [[getPackagesQuery, resolver]];
apolloProvider = createMockApollo(requestHandlers);
wrapper = shallowMountExtended(ListPage, {
localVue,
apolloProvider,
provide,
stubs: {
......
import { GlSprintf, GlToggle } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -33,8 +33,6 @@ import {
jest.mock('~/flash');
jest.mock('~/packages_and_registries/settings/group/graphql/utils/optimistic_responses');
const localVue = createLocalVue();
describe('DependencyProxySettings', () => {
let wrapper;
let apolloProvider;
......@@ -47,7 +45,7 @@ describe('DependencyProxySettings', () => {
groupDependencyProxyPath: 'group_dependency_proxy_path',
};
localVue.use(VueApollo);
Vue.use(VueApollo);
const mountComponent = ({
provide = defaultProvide,
......@@ -63,7 +61,6 @@ describe('DependencyProxySettings', () => {
apolloProvider = createMockApollo(requestHandlers);
wrapper = shallowMountExtended(component, {
localVue,
apolloProvider,
provide,
propsData: {
......
import { GlAlert } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import { nextTick } from 'vue';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
import PackagesSettings from '~/packages_and_registries/settings/group/components/packages_settings.vue';
......@@ -19,8 +20,6 @@ import {
jest.mock('~/flash');
const localVue = createLocalVue();
describe('Group Settings App', () => {
let wrapper;
let apolloProvider;
......@@ -36,14 +35,13 @@ describe('Group Settings App', () => {
resolver = jest.fn().mockResolvedValue(groupPackageSettingsMock),
provide = defaultProvide,
} = {}) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [[getGroupPackagesSettingsQuery, resolver]];
apolloProvider = createMockApollo(requestHandlers);
wrapper = shallowMount(component, {
localVue,
apolloProvider,
provide,
mocks: {
......
import { GlSprintf, GlLink } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -28,8 +28,6 @@ import {
jest.mock('~/flash');
jest.mock('~/packages_and_registries/settings/group/graphql/utils/optimistic_responses');
const localVue = createLocalVue();
describe('Packages Settings', () => {
let wrapper;
let apolloProvider;
......@@ -42,14 +40,13 @@ describe('Packages Settings', () => {
const mountComponent = ({
mutationResolver = jest.fn().mockResolvedValue(groupPackageSettingsMutationMock()),
} = {}) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [[updateNamespacePackageSettings, mutationResolver]];
apolloProvider = createMockApollo(requestHandlers);
wrapper = shallowMountExtended(component, {
localVue,
apolloProvider,
provide: defaultProvide,
propsData: {
......
import { GlAlert, GlSprintf, GlLink } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -20,8 +21,6 @@ import {
containerExpirationPolicyData,
} from '../mock_data';
const localVue = createLocalVue();
describe('Registry Settings App', () => {
let wrapper;
let fakeApollo;
......@@ -56,13 +55,12 @@ describe('Registry Settings App', () => {
};
const mountComponentWithApollo = ({ provide = defaultProvidedValues, resolver } = {}) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [[expirationPolicyQuery, resolver]];
fakeApollo = createMockApollo(requestHandlers);
mountComponent(provide, {
localVue,
apolloProvider: fakeApollo,
});
};
......
import { GlIcon, GlLink, GlLoadingIcon, GlSprintf } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -8,8 +9,7 @@ import getPipelineQuery from '~/pipeline_editor/graphql/queries/pipeline.query.g
import PipelineEditorMiniGraph from '~/pipeline_editor/components/header/pipeline_editor_mini_graph.vue';
import { mockCommitSha, mockProjectPipeline, mockProjectFullPath } from '../../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Pipeline Status', () => {
let wrapper;
......@@ -21,7 +21,6 @@ describe('Pipeline Status', () => {
mockApollo = createMockApollo(handlers);
wrapper = shallowMount(PipelineStatus, {
localVue,
apolloProvider: mockApollo,
propsData: {
commitSha: mockCommitSha,
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -8,8 +9,7 @@ import getLinkedPipelinesQuery from '~/projects/commit_box/info/graphql/queries/
import { PIPELINE_FAILURE } from '~/pipeline_editor/constants';
import { mockLinkedPipelines, mockProjectFullPath, mockProjectPipeline } from '../../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Pipeline Status', () => {
let wrapper;
......@@ -36,7 +36,6 @@ describe('Pipeline Status', () => {
createComponent({
hasStages,
options: {
localVue,
apolloProvider: mockApollo,
},
});
......
import VueApollo from 'vue-apollo';
import { GlIcon } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import { escape } from 'lodash';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -24,8 +25,7 @@ import {
mockYmlHelpPagePath,
} from '../../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Validation segment component', () => {
let wrapper;
......@@ -45,7 +45,6 @@ describe('Validation segment component', () => {
wrapper = extendedWrapper(
shallowMount(ValidationSegment, {
localVue,
apolloProvider: mockApollo,
provide: {
ymlHelpPagePath: mockYmlHelpPagePath,
......
import { GlIntersectionObserver, GlSkeletonLoader } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -9,8 +10,7 @@ import JobsTable from '~/jobs/components/table/jobs_table.vue';
import getPipelineJobsQuery from '~/pipelines/graphql/queries/get_pipeline_jobs.query.graphql';
import { mockPipelineJobsQueryResponse } from '../../mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
jest.mock('~/flash');
......@@ -36,7 +36,6 @@ describe('Jobs app', () => {
fullPath: 'root/ci-project',
pipelineIid: 1,
},
localVue,
apolloProvider: createMockApolloProvider(resolver),
});
};
......
import { mount, shallowMount, createLocalVue } from '@vue/test-utils';
import { mount, shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -41,13 +42,11 @@ describe('Linked Pipelines Column', () => {
const findPipelineGraph = () => wrapper.find(PipelineGraph);
const findExpandButton = () => wrapper.find('[data-testid="expand-pipeline-button"]');
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const createComponent = ({ apolloProvider, mountFn = shallowMount, props = {} } = {}) => {
wrapper = mountFn(LinkedPipelinesColumn, {
apolloProvider,
localVue,
propsData: {
...defaultProps,
...props,
......
import { GlColumnChart } from '@gitlab/ui/dist/charts';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -11,8 +12,7 @@ import CiCdAnalyticsCharts from '~/vue_shared/components/ci_cd_analytics/ci_cd_a
import { mockPipelineCount, mockPipelineStatistics } from '../mock_data';
const projectPath = 'gitlab-org/gitlab';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('~/projects/pipelines/charts/components/pipeline_charts.vue', () => {
let wrapper;
......@@ -31,7 +31,6 @@ describe('~/projects/pipelines/charts/components/pipeline_charts.vue', () => {
provide: {
projectPath,
},
localVue,
apolloProvider: createMockApolloProvider(),
});
......
import { GlLoadingIcon } from '@gitlab/ui';
import { mount, shallowMount, createLocalVue } from '@vue/test-utils';
import { mount, shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -36,11 +37,10 @@ jest.mock('~/lib/utils/common_utils');
let wrapper;
let mockResolver;
const localVue = createLocalVue();
const mockAxios = new MockAdapter(axios);
const createComponent = async (mockData = {}, mountFn = shallowMount) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
const {
blob = simpleViewerMock,
......@@ -75,7 +75,6 @@ const createComponent = async (mockData = {}, mountFn = shallowMount) => {
wrapper = extendedWrapper(
mountFn(BlobContentViewer, {
localVue,
apolloProvider: fakeApollo,
propsData: propsMock,
mixins: [{ data: () => ({ ref: refMock }) }],
......
import { createLocalVue } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import { nextTick } from 'vue';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
import BlobControls from '~/repository/components/blob_controls.vue';
......@@ -16,10 +16,8 @@ let router;
let wrapper;
let mockResolver;
const localVue = createLocalVue();
const createComponent = async () => {
localVue.use(VueApollo);
Vue.use(VueApollo);
const project = { ...blobControlsDataMock };
const projectPath = 'some/project';
......@@ -31,7 +29,6 @@ const createComponent = async () => {
mockResolver = jest.fn().mockResolvedValue({ data: { project } });
wrapper = shallowMountExtended(BlobControls, {
localVue,
router,
apolloProvider: createMockApollo([[blobControlsQuery, mockResolver]]),
propsData: { projectPath },
......
import { createLocalVue, mount, shallowMount } from '@vue/test-utils';
import { mount, shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -18,8 +19,7 @@ jest.mock('~/runner/sentry_utils');
const mockRunnerGraphqlId = runnerData.data.runner.id;
const mockRunnerId = `${getIdFromGraphQLId(mockRunnerGraphqlId)}`;
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('AdminRunnerEditApp', () => {
let wrapper;
......@@ -29,7 +29,6 @@ describe('AdminRunnerEditApp', () => {
const createComponentWithApollo = ({ props = {}, mountFn = shallowMount } = {}) => {
wrapper = mountFn(AdminRunnerEditApp, {
localVue,
apolloProvider: createMockApollo([[getRunnerQuery, mockRunnerQuery]]),
propsData: {
runnerId: mockRunnerId,
......
import { GlDropdown, GlDropdownItem, GlDropdownForm } from '@gitlab/ui';
import { createLocalVue, createWrapper } from '@vue/test-utils';
import { nextTick } from 'vue';
import { mount, shallowMount, createWrapper } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import { shallowMountExtended, mountExtended } from 'helpers/vue_test_utils_helper';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import createMockApollo from 'helpers/mock_apollo_helper';
import RegistrationDropdown from '~/runner/components/registration/registration_dropdown.vue';
......@@ -33,15 +34,17 @@ describe('RegistrationDropdown', () => {
const findToggleMaskButton = () => wrapper.findByTestId('toggle-masked');
const createComponent = ({ props = {}, ...options } = {}, mountFn = shallowMountExtended) => {
wrapper = mountFn(RegistrationDropdown, {
propsData: {
registrationToken: mockToken,
type: INSTANCE_TYPE,
...props,
},
...options,
});
const createComponent = ({ props = {}, ...options } = {}, mountFn = shallowMount) => {
wrapper = extendedWrapper(
mountFn(RegistrationDropdown, {
propsData: {
registrationToken: mockToken,
type: INSTANCE_TYPE,
...props,
},
...options,
}),
);
};
it.each`
......@@ -50,7 +53,7 @@ describe('RegistrationDropdown', () => {
${GROUP_TYPE} | ${'Register a group runner'}
${PROJECT_TYPE} | ${'Register a project runner'}
`('Dropdown text for type $type is "$text"', () => {
createComponent({ props: { type: INSTANCE_TYPE } }, mountExtended);
createComponent({ props: { type: INSTANCE_TYPE } }, mount);
expect(wrapper.text()).toContain('Register an instance runner');
});
......@@ -71,8 +74,7 @@ describe('RegistrationDropdown', () => {
});
describe('When the dropdown item is clicked', () => {
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const requestHandlers = [
[getRunnerPlatformsQuery, jest.fn().mockResolvedValue(mockGraphqlRunnerPlatforms)],
......@@ -85,13 +87,12 @@ describe('RegistrationDropdown', () => {
beforeEach(async () => {
createComponent(
{
localVue,
// Mock load modal contents from API
apolloProvider: createMockApollo(requestHandlers),
// Use `attachTo` to find the modal
attachTo: document.body,
},
mountExtended,
mount,
);
await findRegistrationInstructionsDropdownItem().trigger('click');
......@@ -129,7 +130,7 @@ describe('RegistrationDropdown', () => {
});
it('Displays masked value by default', () => {
createComponent({}, mountExtended);
createComponent({}, mount);
expect(findTokenDropdownItem().text()).toMatchInterpolatedText(
`Registration token ${maskToken}`,
......@@ -152,7 +153,7 @@ describe('RegistrationDropdown', () => {
});
it('Updates the token when it gets reset', async () => {
createComponent({}, mountExtended);
createComponent({}, mount);
const newToken = 'mock1';
......
import Vue, { nextTick } from 'vue';
import { GlDropdownItem, GlLoadingIcon, GlToast, GlModal } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
import { createAlert } from '~/flash';
......@@ -32,7 +33,7 @@ describe('RegistrationTokenResetDropdownItem', () => {
const clickSubmit = () => findModal().vm.$emit('primary', mockEvent);
const createComponent = ({ props, provide = {} } = {}) => {
wrapper = shallowMountExtended(RegistrationTokenResetDropdownItem, {
wrapper = shallowMount(RegistrationTokenResetDropdownItem, {
provide,
propsData: {
type: INSTANCE_TYPE,
......
import Vue, { nextTick } from 'vue';
import { GlLink } from '@gitlab/ui';
import { shallowMount, mount } from '@vue/test-utils';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import setWindowLocation from 'helpers/set_window_location_helper';
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import AssigneesRealtime from '~/sidebar/components/assignees/assignees_realtime.vue';
......@@ -7,8 +8,7 @@ import SidebarMediator from '~/sidebar/sidebar_mediator';
import getIssueAssigneesQuery from '~/vue_shared/components/sidebar/queries/get_issue_assignees.query.graphql';
import Mock, { issuableQueryResponse, subscriptionNullResponse } from './mock_data';
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Assignees Realtime', () => {
let wrapper;
......@@ -38,7 +38,6 @@ describe('Assignees Realtime', () => {
mediator,
},
apolloProvider: fakeApollo,
localVue,
});
};
......
import { GlSearchBoxByType, GlDropdown } 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 VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -23,8 +24,7 @@ const updateIssueAssigneesMutationSuccess = jest
.mockResolvedValue(updateIssueAssigneesMutationResponse);
const mockError = jest.fn().mockRejectedValue('Error!');
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
const initialAssignees = [
{
......@@ -59,7 +59,6 @@ describe('Sidebar assignees widget', () => {
[updateIssueAssigneesMutation, updateIssueAssigneesMutationHandler],
]);
wrapper = shallowMount(SidebarAssigneesWidget, {
localVue,
apolloProvider: fakeApollo,
propsData: {
iid: '1',
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -15,8 +16,7 @@ import { issueConfidentialityResponse } from '../../mock_data';
jest.mock('~/flash');
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Sidebar Confidentiality Widget', () => {
let wrapper;
......@@ -32,7 +32,6 @@ describe('Sidebar Confidentiality Widget', () => {
fakeApollo = createMockApollo([[issueConfidentialQuery, confidentialQueryHandler]]);
wrapper = shallowMount(SidebarConfidentialityWidget, {
localVue,
apolloProvider: fakeApollo,
provide: {
canUpdate: true,
......
......@@ -8,7 +8,8 @@ import {
GlLoadingIcon,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { createLocalVue, shallowMount, mount } from '@vue/test-utils';
import { shallowMount, mount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -37,8 +38,6 @@ import {
jest.mock('~/flash');
const localVue = createLocalVue();
describe('SidebarDropdownWidget', () => {
let wrapper;
let mockApollo;
......@@ -108,7 +107,7 @@ describe('SidebarDropdownWidget', () => {
projectMilestonesSpy = jest.fn().mockResolvedValue(mockProjectMilestonesResponse),
currentMilestoneSpy = jest.fn().mockResolvedValue(noCurrentMilestoneResponse),
} = {}) => {
localVue.use(VueApollo);
Vue.use(VueApollo);
mockApollo = createMockApollo([
[projectMilestonesQuery, projectMilestonesSpy],
[projectIssueMilestoneQuery, currentMilestoneSpy],
......@@ -117,7 +116,6 @@ describe('SidebarDropdownWidget', () => {
wrapper = extendedWrapper(
mount(SidebarDropdownWidget, {
localVue,
provide: { canUpdate: true },
apolloProvider: mockApollo,
propsData: {
......
import { GlLoadingIcon } from '@gitlab/ui';
import { getAllByRole, getByRole } from '@testing-library/dom';
import { shallowMount, createLocalVue, mount } from '@vue/test-utils';
import { shallowMount, mount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -13,8 +14,7 @@ import { getIssueTimelogsQueryResponse, getMrTimelogsQueryResponse } from './moc
jest.mock('~/flash');
describe('Issuable Time Tracking Report', () => {
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
let wrapper;
let fakeApollo;
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
......@@ -37,7 +37,6 @@ describe('Issuable Time Tracking Report', () => {
issuableType,
},
propsData: { limitToHours, issuableId: '1' },
localVue,
apolloProvider: fakeApollo,
});
};
......
import { GlLoadingIcon } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import { merge } from 'lodash';
import { nextTick } from 'vue';
import VueApollo, { ApolloMutation } from 'vue-apollo';
import { useFakeDate } from 'helpers/fake_date';
import createMockApollo from 'helpers/mock_apollo_helper';
......@@ -78,8 +79,7 @@ const getApiData = ({
blobActions: [],
});
const localVue = createLocalVue();
localVue.use(VueApollo);
Vue.use(VueApollo);
describe('Snippet Edit app', () => {
useFakeDate();
......@@ -141,7 +141,6 @@ describe('Snippet Edit app', () => {
wrapper = shallowMount(SnippetEditApp, {
apolloProvider,
localVue,
stubs: {
ApolloMutation,
FormFooterActions,
......
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