Commit 9ad2fbd2 authored by Illya Klymov's avatar Illya Klymov

Remove incorrect localVue usage

localVue is required only with use method
parent 4372a6c9
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlLink, GlBadge } from '@gitlab/ui'; import { GlLink, GlBadge } from '@gitlab/ui';
import component from 'ee/environments_dashboard/components/dashboard/environment_header.vue'; import component from 'ee/environments_dashboard/components/dashboard/environment_header.vue';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import ReviewAppLink from '~/vue_merge_request_widget/components/review_app_link.vue'; import ReviewAppLink from '~/vue_merge_request_widget/components/review_app_link.vue';
const localVue = createLocalVue();
describe('Environment Header', () => { describe('Environment Header', () => {
const Component = localVue.extend(component);
let wrapper; let wrapper;
let propsData; let propsData;
...@@ -27,11 +24,10 @@ describe('Environment Header', () => { ...@@ -27,11 +24,10 @@ describe('Environment Header', () => {
describe('renders name and link to app', () => { describe('renders name and link to app', () => {
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(Component, { wrapper = shallowMount(component, {
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
propsData, propsData,
localVue,
}); });
}); });
...@@ -64,11 +60,10 @@ describe('Environment Header', () => { ...@@ -64,11 +60,10 @@ describe('Environment Header', () => {
propsData.environment.within_folder = true; propsData.environment.within_folder = true;
propsData.environment.name = 'review/testing'; propsData.environment.name = 'review/testing';
wrapper = shallowMount(Component, { wrapper = shallowMount(component, {
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
propsData, propsData,
localVue,
}); });
}); });
...@@ -91,11 +86,10 @@ describe('Environment Header', () => { ...@@ -91,11 +86,10 @@ describe('Environment Header', () => {
beforeEach(() => { beforeEach(() => {
propsData.hasErrors = true; propsData.hasErrors = true;
wrapper = shallowMount(Component, { wrapper = shallowMount(component, {
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
propsData, propsData,
localVue,
}); });
}); });
...@@ -108,11 +102,10 @@ describe('Environment Header', () => { ...@@ -108,11 +102,10 @@ describe('Environment Header', () => {
beforeEach(() => { beforeEach(() => {
propsData.hasPipelineFailed = true; propsData.hasPipelineFailed = true;
wrapper = shallowMount(Component, { wrapper = shallowMount(component, {
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
propsData, propsData,
localVue,
}); });
}); });
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import component from 'ee/environments_dashboard/components/dashboard/environment.vue'; import component from 'ee/environments_dashboard/components/dashboard/environment.vue';
import EnvironmentHeader from 'ee/environments_dashboard/components/dashboard/environment_header.vue'; import EnvironmentHeader from 'ee/environments_dashboard/components/dashboard/environment_header.vue';
import Alert from 'ee/vue_shared/dashboards/components/alerts.vue'; import Alert from 'ee/vue_shared/dashboards/components/alerts.vue';
import Commit from '~/vue_shared/components/commit.vue'; import Commit from '~/vue_shared/components/commit.vue';
import environment from './mock_environment.json'; import environment from './mock_environment.json';
const localVue = createLocalVue();
describe('Environment', () => { describe('Environment', () => {
const Component = localVue.extend(component);
let wrapper; let wrapper;
let propsData; let propsData;
...@@ -16,10 +13,9 @@ describe('Environment', () => { ...@@ -16,10 +13,9 @@ describe('Environment', () => {
propsData = { propsData = {
environment, environment,
}; };
wrapper = shallowMount(Component, { wrapper = shallowMount(component, {
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
localVue,
propsData, propsData,
}); });
}); });
...@@ -95,10 +91,9 @@ describe('Environment', () => { ...@@ -95,10 +91,9 @@ describe('Environment', () => {
last_deployment: null, last_deployment: null,
}, },
}; };
wrapper = shallowMount(Component, { wrapper = shallowMount(component, {
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
localVue,
propsData, propsData,
}); });
...@@ -115,10 +110,9 @@ describe('Environment', () => { ...@@ -115,10 +110,9 @@ describe('Environment', () => {
}, },
}, },
}; };
wrapper = shallowMount(Component, { wrapper = shallowMount(component, {
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
localVue,
propsData, propsData,
}); });
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import component from 'ee/environments_dashboard/components/dashboard/project_header.vue'; import component from 'ee/environments_dashboard/components/dashboard/project_header.vue';
import ProjectAvatar from '~/vue_shared/components/project_avatar/default.vue'; import ProjectAvatar from '~/vue_shared/components/project_avatar/default.vue';
const localVue = createLocalVue();
describe('Project Header', () => { describe('Project Header', () => {
const Component = localVue.extend(component);
let wrapper; let wrapper;
let propsData; let propsData;
...@@ -24,11 +21,10 @@ describe('Project Header', () => { ...@@ -24,11 +21,10 @@ describe('Project Header', () => {
}); });
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(Component, { wrapper = shallowMount(component, {
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
propsData, propsData,
localVue,
}); });
}); });
......
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