Commit 9215be6a authored by Illya Klymov's avatar Illya Klymov

Remove incorrect localVue usage

localVue is required only with use method
parent 4372a6c9
...@@ -34,7 +34,7 @@ describe('ProductivityApp component', () => { ...@@ -34,7 +34,7 @@ describe('ProductivityApp component', () => {
const mainChartData = { 1: 2, 2: 3 }; const mainChartData = { 1: 2, 2: 3 };
const createComponent = (scatterplotEnabled = true) => { const createComponent = (scatterplotEnabled = true) => {
wrapper = shallowMount(localVue.extend(ProductivityApp), { wrapper = shallowMount(ProductivityApp, {
localVue, localVue,
store, store,
sync: false, sync: false,
......
...@@ -23,7 +23,7 @@ describe('FilterDropdowns component', () => { ...@@ -23,7 +23,7 @@ describe('FilterDropdowns component', () => {
const projectId = 10; const projectId = 10;
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(localVue.extend(FilterDropdowns), { wrapper = shallowMount(FilterDropdowns, {
localVue, localVue,
store, store,
sync: false, sync: false,
......
...@@ -37,7 +37,7 @@ describe('Approvals ModalRuleRemove', () => { ...@@ -37,7 +37,7 @@ describe('Approvals ModalRuleRemove', () => {
...options.propsData, ...options.propsData,
}; };
wrapper = shallowMount(localVue.extend(ModalRuleRemove), { wrapper = shallowMount(ModalRuleRemove, {
...options, ...options,
localVue, localVue,
store, store,
......
...@@ -14,7 +14,6 @@ const localVue = createLocalVue(); ...@@ -14,7 +14,6 @@ const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
describe('dashboard', () => { describe('dashboard', () => {
const Component = localVue.extend(component);
let actionSpies; let actionSpies;
const store = createStore(); const store = createStore();
let wrapper; let wrapper;
...@@ -38,7 +37,7 @@ describe('dashboard', () => { ...@@ -38,7 +37,7 @@ describe('dashboard', () => {
emptyDashboardHelpPath: '/help/user/operations_dashboard/index.html', emptyDashboardHelpPath: '/help/user/operations_dashboard/index.html',
}; };
wrapper = shallowMount(Component, { wrapper = shallowMount(component, {
propsData, propsData,
localVue, localVue,
store, store,
......
...@@ -22,7 +22,7 @@ describe('Edit feature flag form', () => { ...@@ -22,7 +22,7 @@ describe('Edit feature flag form', () => {
}); });
const factory = () => { const factory = () => {
wrapper = shallowMount(localVue.extend(EditFeatureFlag), { wrapper = shallowMount(EditFeatureFlag, {
localVue, localVue,
propsData: { propsData: {
endpoint: `${TEST_HOST}/feature_flags.json'`, endpoint: `${TEST_HOST}/feature_flags.json'`,
......
...@@ -20,7 +20,7 @@ describe('Step', () => { ...@@ -20,7 +20,7 @@ describe('Step', () => {
}; };
const factory = propsData => { const factory = propsData => {
wrapper = shallowMount(localVue.extend(component), { wrapper = shallowMount(component, {
store, store,
propsData: { ...initialData, ...propsData }, propsData: { ...initialData, ...propsData },
localVue, localVue,
......
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlSingleStat } from '@gitlab/ui/dist/charts'; import { GlSingleStat } from '@gitlab/ui/dist/charts';
import createStore from 'ee/threat_monitoring/store'; import createStore from 'ee/threat_monitoring/store';
import WafStatisticsSummary from 'ee/threat_monitoring/components/waf_statistics_summary.vue'; import WafStatisticsSummary from 'ee/threat_monitoring/components/waf_statistics_summary.vue';
import { mockWafStatisticsResponse } from '../mock_data'; import { mockWafStatisticsResponse } from '../mock_data';
const localVue = createLocalVue();
describe('WafStatisticsSummary component', () => { describe('WafStatisticsSummary component', () => {
let store; let store;
let wrapper; let wrapper;
...@@ -15,7 +13,6 @@ describe('WafStatisticsSummary component', () => { ...@@ -15,7 +13,6 @@ describe('WafStatisticsSummary component', () => {
Object.assign(store.state.threatMonitoring, state); Object.assign(store.state.threatMonitoring, state);
wrapper = shallowMount(WafStatisticsSummary, { wrapper = shallowMount(WafStatisticsSummary, {
localVue,
store, store,
sync: false, sync: false,
}); });
......
...@@ -25,7 +25,7 @@ describe('Diff settiings dropdown component', () => { ...@@ -25,7 +25,7 @@ describe('Diff settiings dropdown component', () => {
extendStore(store); extendStore(store);
vm = mount(localVue.extend(SettingsDropdown), { vm = mount(SettingsDropdown, {
localVue, localVue,
store, store,
sync: false, sync: false,
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import searchComponent from '~/frequent_items/components/frequent_items_search_input.vue'; import searchComponent from '~/frequent_items/components/frequent_items_search_input.vue';
import eventHub from '~/frequent_items/event_hub'; import eventHub from '~/frequent_items/event_hub';
const localVue = createLocalVue();
const createComponent = (namespace = 'projects') => const createComponent = (namespace = 'projects') =>
shallowMount(localVue.extend(searchComponent), { shallowMount(searchComponent, {
propsData: { namespace }, propsData: { namespace },
localVue,
sync: false, sync: false,
}); });
...@@ -42,7 +39,7 @@ describe('FrequentItemsSearchInputComponent', () => { ...@@ -42,7 +39,7 @@ describe('FrequentItemsSearchInputComponent', () => {
jest.spyOn(eventHub, '$on').mockImplementation(() => {}); jest.spyOn(eventHub, '$on').mockImplementation(() => {});
const vmX = createComponent().vm; const vmX = createComponent().vm;
localVue.nextTick(() => { vmX.$nextTick(() => {
expect(eventHub.$on).toHaveBeenCalledWith( expect(eventHub.$on).toHaveBeenCalledWith(
`${vmX.namespace}-dropdownOpen`, `${vmX.namespace}-dropdownOpen`,
expect.any(Function), expect.any(Function),
...@@ -60,7 +57,7 @@ describe('FrequentItemsSearchInputComponent', () => { ...@@ -60,7 +57,7 @@ describe('FrequentItemsSearchInputComponent', () => {
vmX.$mount(); vmX.$mount();
vmX.$destroy(); vmX.$destroy();
localVue.nextTick(() => { vmX.$nextTick(() => {
expect(eventHub.$off).toHaveBeenCalledWith( expect(eventHub.$off).toHaveBeenCalledWith(
`${vmX.namespace}-dropdownOpen`, `${vmX.namespace}-dropdownOpen`,
expect.any(Function), expect.any(Function),
......
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