Commit 0461c4ef authored by Natalia Tepluhina's avatar Natalia Tepluhina Committed by Phil Hughes

Clean unnecessary 'localVue' in various specs on 'spec/frontend'

parent 8e6d4aad
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
import ProjectFormGroup from '~/confidential_merge_request/components/project_form_group.vue';
const localVue = createLocalVue();
const mockData = [
{
id: 1,
......@@ -30,7 +29,6 @@ function factory(projects = mockData) {
mock.onGet(/api\/(.*)\/projects\/gitlab-org%2Fgitlab-ce\/forks/).reply(200, projects);
vm = shallowMount(ProjectFormGroup, {
localVue,
propsData: {
namespacePath: 'gitlab-org',
projectPath: 'gitlab-org/gitlab-ce',
......@@ -49,7 +47,7 @@ describe('Confidential merge request project form group component', () => {
it('renders fork dropdown', () => {
factory();
return localVue.nextTick(() => {
return vm.vm.$nextTick(() => {
expect(vm.element).toMatchSnapshot();
});
});
......@@ -57,7 +55,7 @@ describe('Confidential merge request project form group component', () => {
it('sets selected project as first fork', () => {
factory();
return localVue.nextTick(() => {
return vm.vm.$nextTick(() => {
expect(vm.vm.selectedProject).toEqual({
id: 1,
name: 'root / gitlab-ce',
......@@ -70,7 +68,7 @@ describe('Confidential merge request project form group component', () => {
it('renders empty state when response is empty', () => {
factory([]);
return localVue.nextTick(() => {
return vm.vm.$nextTick(() => {
expect(vm.element).toMatchSnapshot();
});
});
......
import Vue from 'vue';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import { createStore } from '~/contributors/stores';
import axios from '~/lib/utils/axios_utils';
import ContributorsCharts from '~/contributors/components/contributors.vue';
const localVue = createLocalVue();
let wrapper;
let mock;
let store;
......@@ -52,7 +51,7 @@ describe('Contributors charts', () => {
it('should display loader whiled loading data', () => {
wrapper.vm.$store.state.loading = true;
return localVue.nextTick(() => {
return wrapper.vm.$nextTick(() => {
expect(wrapper.find('.contributors-loader').exists()).toBe(true);
});
});
......@@ -60,7 +59,7 @@ describe('Contributors charts', () => {
it('should render charts when loading completed and there is chart data', () => {
wrapper.vm.$store.state.loading = false;
wrapper.vm.$store.state.chartData = chartData;
return localVue.nextTick(() => {
return wrapper.vm.$nextTick(() => {
expect(wrapper.find('.contributors-loader').exists()).toBe(false);
expect(wrapper.find('.contributors-charts').exists()).toBe(true);
expect(wrapper.element).toMatchSnapshot();
......
......@@ -25,7 +25,7 @@ describe('ide/components/ide_status_list', () => {
},
});
wrapper = shallowMount(localVue.extend(IdeStatusList), {
wrapper = shallowMount(IdeStatusList, {
localVue,
sync: false,
store,
......
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import { GlEmptyState, GlPagination, GlSkeletonLoading } from '@gitlab/ui';
import waitForPromises from 'helpers/wait_for_promises';
import { TEST_HOST } from 'helpers/test_constants';
......@@ -18,8 +18,6 @@ const TEST_ENDPOINT = '/issues';
const TEST_CREATE_ISSUES_PATH = '/createIssue';
const TEST_EMPTY_SVG_PATH = '/emptySvg';
const localVue = createLocalVue();
const MOCK_ISSUES = Array(PAGE_SIZE_MANUAL)
.fill(0)
.map((_, i) => ({
......@@ -40,14 +38,13 @@ describe('Issuables list component', () => {
};
const factory = (props = { sortKey: 'priority' }) => {
wrapper = shallowMount(localVue.extend(IssuablesListApp), {
wrapper = shallowMount(IssuablesListApp, {
propsData: {
endpoint: TEST_ENDPOINT,
createIssuePath: TEST_CREATE_ISSUES_PATH,
emptySvgPath: TEST_EMPTY_SVG_PATH,
...props,
},
localVue,
sync: false,
attachToDocument: true,
});
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui';
import PinnedLinks from '~/issue_show/components/pinned_links.vue';
const localVue = createLocalVue();
const plainZoomUrl = 'https://zoom.us/j/123456789';
describe('PinnedLinks', () => {
......@@ -19,8 +17,7 @@ describe('PinnedLinks', () => {
};
const createComponent = props => {
wrapper = shallowMount(localVue.extend(PinnedLinks), {
localVue,
wrapper = shallowMount(PinnedLinks, {
sync: false,
propsData: {
zoomMeetingUrl: null,
......
import { mount, shallowMount, createLocalVue } from '@vue/test-utils';
import { mount, shallowMount } from '@vue/test-utils';
import { GlButton, GlLink, GlFormGroup, GlFormInput } from '@gitlab/ui';
import { TEST_HOST } from 'helpers/test_constants';
import ExternalDashboard from '~/operation_settings/components/external_dashboard.vue';
......@@ -15,12 +15,10 @@ describe('operation settings external dashboard component', () => {
const operationsSettingsEndpoint = `${TEST_HOST}/mock/ops/settings/endpoint`;
const externalDashboardUrl = `http://mock-external-domain.com/external/dashboard/url`;
const externalDashboardHelpPagePath = `${TEST_HOST}/help/page/path`;
const localVue = createLocalVue();
const mountComponent = (shallow = true) => {
const config = [
ExternalDashboard,
{
localVue,
store: store({
operationsSettingsEndpoint,
externalDashboardUrl,
......
import { mount, createLocalVue } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui';
import { truncateSha } from '~/lib/utils/text_utility';
import Icon from '~/vue_shared/components/icon.vue';
......@@ -10,10 +10,7 @@ describe('Evidence Block', () => {
let wrapper;
const factory = (options = {}) => {
const localVue = createLocalVue();
wrapper = mount(localVue.extend(EvidenceBlock), {
localVue,
wrapper = mount(EvidenceBlock, {
...options,
});
};
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import environmentRowComponent from '~/serverless/components/environment_row.vue';
import { mockServerlessFunctions, mockServerlessFunctionsDiffEnv } from '../mock_data';
import { translate } from '~/serverless/utils';
const createComponent = (localVue, env, envName) =>
shallowMount(environmentRowComponent, { localVue, propsData: { env, envName }, sync: false }).vm;
const createComponent = (env, envName) =>
shallowMount(environmentRowComponent, { propsData: { env, envName }, sync: false }).vm;
describe('environment row component', () => {
describe('default global cluster case', () => {
let localVue;
let vm;
beforeEach(() => {
localVue = createLocalVue();
vm = createComponent(localVue, translate(mockServerlessFunctions.functions)['*'], '*');
vm = createComponent(translate(mockServerlessFunctions.functions)['*'], '*');
});
afterEach(() => vm.$destroy());
......@@ -44,15 +42,9 @@ describe('environment row component', () => {
describe('default named cluster case', () => {
let vm;
let localVue;
beforeEach(() => {
localVue = createLocalVue();
vm = createComponent(
localVue,
translate(mockServerlessFunctionsDiffEnv.functions).test,
'test',
);
vm = createComponent(translate(mockServerlessFunctionsDiffEnv.functions).test, 'test');
});
afterEach(() => vm.$destroy());
......
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