Commit 4658cdaa authored by Illya Klymov's avatar Illya Klymov

Remove incorrect localVue usage

localVue is required only with use method
parent 4372a6c9
...@@ -24,13 +24,12 @@ const localVue = createLocalVue(); ...@@ -24,13 +24,12 @@ const localVue = createLocalVue();
const expectedPanelCount = 2; const expectedPanelCount = 2;
describe('Dashboard', () => { describe('Dashboard', () => {
let DashboardComponent;
let store; let store;
let wrapper; let wrapper;
let mock; let mock;
const createShallowWrapper = (props = {}, options = {}) => { const createShallowWrapper = (props = {}, options = {}) => {
wrapper = shallowMount(localVue.extend(DashboardComponent), { wrapper = shallowMount(Dashboard, {
localVue, localVue,
sync: false, sync: false,
propsData: { ...propsData, ...props }, propsData: { ...propsData, ...props },
...@@ -40,7 +39,7 @@ describe('Dashboard', () => { ...@@ -40,7 +39,7 @@ describe('Dashboard', () => {
}; };
const createMountedWrapper = (props = {}, options = {}) => { const createMountedWrapper = (props = {}, options = {}) => {
wrapper = mount(localVue.extend(DashboardComponent), { wrapper = mount(Dashboard, {
localVue, localVue,
sync: false, sync: false,
propsData: { ...propsData, ...props }, propsData: { ...propsData, ...props },
...@@ -51,7 +50,6 @@ describe('Dashboard', () => { ...@@ -51,7 +50,6 @@ describe('Dashboard', () => {
beforeEach(() => { beforeEach(() => {
store = createStore(); store = createStore();
DashboardComponent = localVue.extend(Dashboard);
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
}); });
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import createFlash from '~/flash'; import createFlash from '~/flash';
import Dashboard from '~/monitoring/components/dashboard.vue'; import Dashboard from '~/monitoring/components/dashboard.vue';
import { createStore } from '~/monitoring/stores'; import { createStore } from '~/monitoring/stores';
import { propsData } from '../init_utils'; import { propsData } from '../init_utils';
const localVue = createLocalVue();
jest.mock('~/flash'); jest.mock('~/flash');
jest.mock('~/lib/utils/url_utility', () => ({ jest.mock('~/lib/utils/url_utility', () => ({
...@@ -17,8 +15,7 @@ describe('dashboard invalid url parameters', () => { ...@@ -17,8 +15,7 @@ describe('dashboard invalid url parameters', () => {
let wrapper; let wrapper;
const createMountedWrapper = (props = {}, options = {}) => { const createMountedWrapper = (props = {}, options = {}) => {
wrapper = mount(localVue.extend(Dashboard), { wrapper = mount(Dashboard, {
localVue,
sync: false, sync: false,
propsData: { ...propsData, ...props }, propsData: { ...propsData, ...props },
store, store,
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { GlDropdownItem } from '@gitlab/ui'; import { GlDropdownItem } from '@gitlab/ui';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
...@@ -8,8 +8,6 @@ import { createStore } from '~/monitoring/stores'; ...@@ -8,8 +8,6 @@ import { createStore } from '~/monitoring/stores';
import { propsData, setupComponentStore } from '../init_utils'; import { propsData, setupComponentStore } from '../init_utils';
import { metricsGroupsAPIResponse, mockApiEndpoint } from '../mock_data'; import { metricsGroupsAPIResponse, mockApiEndpoint } from '../mock_data';
const localVue = createLocalVue();
jest.mock('~/lib/utils/url_utility', () => ({ jest.mock('~/lib/utils/url_utility', () => ({
getParameterValues: jest.fn().mockImplementation(param => { getParameterValues: jest.fn().mockImplementation(param => {
if (param === 'start') return ['2019-10-01T18:27:47.000Z']; if (param === 'start') return ['2019-10-01T18:27:47.000Z'];
...@@ -25,8 +23,7 @@ describe('dashboard time window', () => { ...@@ -25,8 +23,7 @@ describe('dashboard time window', () => {
let mock; let mock;
const createComponentWrapperMounted = (props = {}, options = {}) => { const createComponentWrapperMounted = (props = {}, options = {}) => {
wrapper = mount(localVue.extend(Dashboard), { wrapper = mount(Dashboard, {
localVue,
sync: false, sync: false,
propsData: { ...propsData, ...props }, propsData: { ...propsData, ...props },
store, store,
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import GraphGroup from '~/monitoring/components/graph_group.vue'; import GraphGroup from '~/monitoring/components/graph_group.vue';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
const localVue = createLocalVue();
describe('Graph group component', () => { describe('Graph group component', () => {
let wrapper; let wrapper;
...@@ -12,10 +10,9 @@ describe('Graph group component', () => { ...@@ -12,10 +10,9 @@ describe('Graph group component', () => {
const findCaretIcon = () => wrapper.find(Icon); const findCaretIcon = () => wrapper.find(Icon);
const createComponent = propsData => { const createComponent = propsData => {
wrapper = shallowMount(localVue.extend(GraphGroup), { wrapper = shallowMount(GraphGroup, {
propsData, propsData,
sync: false, sync: false,
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