Commit d6100d36 authored by Illya Klymov's avatar Illya Klymov

Remove incorrect localVue usage

localVue is required only with use method
parent 4372a6c9
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Callout from '~/vue_shared/components/callout.vue'; import Callout from '~/vue_shared/components/callout.vue';
const TEST_MESSAGE = 'This is a callout message!'; const TEST_MESSAGE = 'This is a callout message!';
const TEST_SLOT = '<button>This is a callout slot!</button>'; const TEST_SLOT = '<button>This is a callout slot!</button>';
const localVue = createLocalVue();
describe('Callout Component', () => { describe('Callout Component', () => {
let wrapper; let wrapper;
const factory = options => { const factory = options => {
wrapper = shallowMount(localVue.extend(Callout), { wrapper = shallowMount(Callout, {
localVue,
...options, ...options,
}); });
}; };
......
import Vue from 'vue'; import Vue from 'vue';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import ExpandButton from '~/vue_shared/components/expand_button.vue'; import ExpandButton from '~/vue_shared/components/expand_button.vue';
const text = { const text = {
...@@ -14,10 +14,7 @@ describe('Expand button', () => { ...@@ -14,10 +14,7 @@ describe('Expand button', () => {
const expanderAppendEl = () => wrapper.find('.js-text-expander-append'); const expanderAppendEl = () => wrapper.find('.js-text-expander-append');
const factory = (options = {}) => { const factory = (options = {}) => {
const localVue = createLocalVue(); wrapper = mount(ExpandButton, {
wrapper = mount(localVue.extend(ExpandButton), {
localVue,
...options, ...options,
}); });
}; };
......
import Vue from 'vue'; import Vue from 'vue';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { formatDate } from '~/lib/utils/datetime_utility'; import { formatDate } from '~/lib/utils/datetime_utility';
import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue'; import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue';
import { import {
...@@ -29,10 +29,7 @@ describe('RelatedIssuableItem', () => { ...@@ -29,10 +29,7 @@ describe('RelatedIssuableItem', () => {
}; };
beforeEach(() => { beforeEach(() => {
const localVue = createLocalVue(); wrapper = mount(RelatedIssuableItem, {
wrapper = mount(localVue.extend(RelatedIssuableItem), {
localVue,
slots, slots,
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
......
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import SuggestionDiffHeader from '~/vue_shared/components/markdown/suggestion_diff_header.vue'; import SuggestionDiffHeader from '~/vue_shared/components/markdown/suggestion_diff_header.vue';
const localVue = createLocalVue();
const DEFAULT_PROPS = { const DEFAULT_PROPS = {
canApply: true, canApply: true,
isApplied: false, isApplied: false,
...@@ -14,12 +12,11 @@ describe('Suggestion Diff component', () => { ...@@ -14,12 +12,11 @@ describe('Suggestion Diff component', () => {
let wrapper; let wrapper;
const createComponent = props => { const createComponent = props => {
wrapper = shallowMount(localVue.extend(SuggestionDiffHeader), { wrapper = shallowMount(SuggestionDiffHeader, {
propsData: { propsData: {
...DEFAULT_PROPS, ...DEFAULT_PROPS,
...props, ...props,
}, },
localVue,
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
}); });
......
import { createLocalVue, mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import IssueSystemNote from '~/vue_shared/components/notes/system_note.vue'; import IssueSystemNote from '~/vue_shared/components/notes/system_note.vue';
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import initMRPopovers from '~/mr_popover/index'; import initMRPopovers from '~/mr_popover/index';
jest.mock('~/mr_popover/index', () => jest.fn()); jest.mock('~/mr_popover/index', () => jest.fn());
const localVue = createLocalVue();
describe('system note component', () => { describe('system note component', () => {
let vm; let vm;
let props; let props;
...@@ -34,7 +32,6 @@ describe('system note component', () => { ...@@ -34,7 +32,6 @@ describe('system note component', () => {
vm = mount(IssueSystemNote, { vm = mount(IssueSystemNote, {
store, store,
localVue,
propsData: props, propsData: props,
attachToDocument: true, attachToDocument: true,
sync: false, sync: false,
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue';
describe(`TimelineEntryItem`, () => { describe(`TimelineEntryItem`, () => {
let wrapper; let wrapper;
const factory = (options = {}) => { const factory = (options = {}) => {
const localVue = createLocalVue();
wrapper = shallowMount(TimelineEntryItem, { wrapper = shallowMount(TimelineEntryItem, {
localVue,
...options, ...options,
}); });
}; };
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { GlPagination } from '@gitlab/ui'; import { GlPagination } from '@gitlab/ui';
import PaginationLinks from '~/vue_shared/components/pagination_links.vue'; import PaginationLinks from '~/vue_shared/components/pagination_links.vue';
import { import {
...@@ -10,8 +10,6 @@ import { ...@@ -10,8 +10,6 @@ import {
LABEL_LAST_PAGE, LABEL_LAST_PAGE,
} from '~/vue_shared/components/pagination/constants'; } from '~/vue_shared/components/pagination/constants';
const localVue = createLocalVue();
describe('Pagination links component', () => { describe('Pagination links component', () => {
const pageInfo = { const pageInfo = {
page: 3, page: 3,
...@@ -38,7 +36,6 @@ describe('Pagination links component', () => { ...@@ -38,7 +36,6 @@ describe('Pagination links component', () => {
change: changeMock, change: changeMock,
pageInfo, pageInfo,
}, },
localVue,
sync: false, sync: false,
}); });
}; };
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import { formatDate, getTimeago } from '~/lib/utils/datetime_utility'; import { formatDate, getTimeago } from '~/lib/utils/datetime_utility';
...@@ -10,7 +10,6 @@ describe('Time ago with tooltip component', () => { ...@@ -10,7 +10,6 @@ describe('Time ago with tooltip component', () => {
attachToDocument: true, attachToDocument: true,
sync: false, sync: false,
propsData, propsData,
localVue: createLocalVue(),
}); });
}; };
const timestamp = '2017-05-08T14:57:39.781Z'; const timestamp = '2017-05-08T14:57:39.781Z';
......
import Vue from 'vue'; import Vue from 'vue';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import TrackEvent from '~/vue_shared/directives/track_event'; import TrackEvent from '~/vue_shared/directives/track_event';
...@@ -17,15 +17,12 @@ const Component = Vue.component('dummy-element', { ...@@ -17,15 +17,12 @@ const Component = Vue.component('dummy-element', {
template: '<button id="trackable" v-track-event="trackingOptions"></button>', template: '<button id="trackable" v-track-event="trackingOptions"></button>',
}); });
const localVue = createLocalVue();
let wrapper; let wrapper;
let button; let button;
describe('Error Tracking directive', () => { describe('Error Tracking directive', () => {
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(localVue.extend(Component), { wrapper = shallowMount(Component, {});
localVue,
});
button = wrapper.find('#trackable'); button = wrapper.find('#trackable');
}); });
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import DroplabDropdownButton from '~/vue_shared/components/droplab_dropdown_button.vue'; import DroplabDropdownButton from '~/vue_shared/components/droplab_dropdown_button.vue';
...@@ -18,11 +18,8 @@ const createComponent = ({ ...@@ -18,11 +18,8 @@ const createComponent = ({
dropdownClass = '', dropdownClass = '',
actions = mockActions, actions = mockActions,
defaultAction = 0, defaultAction = 0,
}) => { }) =>
const localVue = createLocalVue(); mount(DroplabDropdownButton, {
return mount(DroplabDropdownButton, {
localVue,
propsData: { propsData: {
size, size,
dropdownClass, dropdownClass,
...@@ -30,7 +27,6 @@ const createComponent = ({ ...@@ -30,7 +27,6 @@ const createComponent = ({
defaultAction, defaultAction,
}, },
}); });
};
describe('DroplabDropdownButton', () => { describe('DroplabDropdownButton', () => {
let wrapper; let wrapper;
......
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
const localVue = createLocalVue();
describe('GitLab Feature Flags Mixin', () => { describe('GitLab Feature Flags Mixin', () => {
let wrapper; let wrapper;
...@@ -20,7 +18,6 @@ describe('GitLab Feature Flags Mixin', () => { ...@@ -20,7 +18,6 @@ describe('GitLab Feature Flags Mixin', () => {
}; };
wrapper = shallowMount(component, { wrapper = shallowMount(component, {
localVue,
provide: { provide: {
glFeatures: { ...(gon.features || {}) }, glFeatures: { ...(gon.features || {}) },
}, },
......
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