Commit 9e8572bf authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'slashmanov/remove-local-vue-non-ee-1' into 'master'

Remove localVue usage from non-EE tests without VueApollo (1/3)

See merge request gitlab-org/gitlab!78873
parents 4dc9e439 0570d6f3
import { GlModal, GlSearchBoxByType } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import getDiffWithCommit from 'test_fixtures/merge_request_diffs/with_commit.json';
import AddReviewItemsModal from '~/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue';
......@@ -8,8 +9,7 @@ import * as actions from '~/add_context_commits_modal/store/actions';
import mutations from '~/add_context_commits_modal/store/mutations';
import defaultState from '~/add_context_commits_modal/store/state';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('AddContextCommitsModal', () => {
let wrapper;
......@@ -36,7 +36,6 @@ describe('AddContextCommitsModal', () => {
});
wrapper = shallowMount(AddReviewItemsModal, {
localVue,
store,
propsData: {
contextCommitsPath: '',
......
import { GlModal } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import BadgeList from '~/badges/components/badge_list.vue';
import BadgeListRow from '~/badges/components/badge_list_row.vue';
......@@ -7,8 +8,7 @@ import BadgeSettings from '~/badges/components/badge_settings.vue';
import store from '~/badges/store';
import { createDummyBadge } from '../dummy_badge';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('BadgeSettings component', () => {
let wrapper;
......@@ -21,7 +21,6 @@ describe('BadgeSettings component', () => {
wrapper = shallowMount(BadgeSettings, {
store,
localVue,
stubs: {
'badge-list': BadgeList,
'badge-list-row': BadgeListRow,
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import DiffFileDrafts from '~/batch_comments/components/diff_file_drafts.vue';
import DraftNote from '~/batch_comments/components/draft_note.vue';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('Batch comments diff file drafts component', () => {
let vm;
......@@ -22,9 +21,8 @@ describe('Batch comments diff file drafts component', () => {
},
});
vm = shallowMount(localVue.extend(DiffFileDrafts), {
vm = shallowMount(DiffFileDrafts, {
store,
localVue,
propsData: { fileHash: 'filehash' },
});
}
......
import { getByRole } from '@testing-library/dom';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import { stubComponent } from 'helpers/stub_component';
import DraftNote from '~/batch_comments/components/draft_note.vue';
import { createStore } from '~/batch_comments/stores';
......@@ -7,8 +7,6 @@ import NoteableNote from '~/notes/components/noteable_note.vue';
import '~/behaviors/markdown/render_gfm';
import { createDraft } from '../mock_data';
const localVue = createLocalVue();
const NoteableNoteStub = stubComponent(NoteableNote, {
template: `
<div>
......@@ -31,10 +29,9 @@ describe('Batch comments draft note component', () => {
const getList = () => getByRole(wrapper.element, 'list');
const createComponent = (propsData = { draft }) => {
wrapper = shallowMount(localVue.extend(DraftNote), {
wrapper = shallowMount(DraftNote, {
store,
propsData,
localVue,
stubs: {
NoteableNote: NoteableNoteStub,
},
......
import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import PreviewDropdown from '~/batch_comments/components/preview_dropdown.vue';
import { createStore } from '~/mr_notes/stores';
import '~/behaviors/markdown/render_gfm';
import { createDraft } from '../mock_data';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('Batch comments publish dropdown component', () => {
let wrapper;
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import BoardNewIssue from '~/boards/components/board_new_issue.vue';
import BoardNewItem from '~/boards/components/board_new_item.vue';
......@@ -7,9 +8,7 @@ import eventHub from '~/boards/eventhub';
import { mockList, mockGroupProjects } from '../mock_data';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
const addListNewIssuesSpy = jest.fn().mockResolvedValue();
const mockActions = { addListNewIssue: addListNewIssuesSpy };
......@@ -20,7 +19,6 @@ const createComponent = ({
getters = { isGroupBoard: () => true, isProjectBoard: () => false },
} = {}) =>
shallowMount(BoardNewIssue, {
localVue,
store: new Vuex.Store({
state,
actions,
......
import { GlDropdown, GlDropdownItem, GlIcon } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import CiEnvironmentsDropdown from '~/ci_variable_list/components/ci_environments_dropdown.vue';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('Ci environments dropdown', () => {
let wrapper;
......@@ -22,7 +22,6 @@ describe('Ci environments dropdown', () => {
wrapper = mount(CiEnvironmentsDropdown, {
store,
localVue,
propsData: {
value: term,
},
......
import { GlButton, GlFormInput } from '@gitlab/ui';
import { createLocalVue, shallowMount, mount } from '@vue/test-utils';
import { shallowMount, mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import { mockTracking } from 'helpers/tracking_helper';
import CiEnvironmentsDropdown from '~/ci_variable_list/components/ci_environments_dropdown.vue';
......@@ -9,8 +10,7 @@ import createStore from '~/ci_variable_list/store';
import mockData from '../services/mock_data';
import ModalStub from '../stubs';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('Ci variable modal', () => {
let wrapper;
......@@ -26,7 +26,6 @@ describe('Ci variable modal', () => {
stubs: {
GlModal: ModalStub,
},
localVue,
store,
...options,
});
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import CiVariableSettings from '~/ci_variable_list/components/ci_variable_settings.vue';
import createStore from '~/ci_variable_list/store';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('Ci variable table', () => {
let wrapper;
......@@ -16,7 +16,6 @@ describe('Ci variable table', () => {
store.state.isGroup = groupState;
jest.spyOn(store, 'dispatch').mockImplementation();
wrapper = shallowMount(CiVariableSettings, {
localVue,
store,
});
};
......
import { createLocalVue, mount } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import CiVariableTable from '~/ci_variable_list/components/ci_variable_table.vue';
import createStore from '~/ci_variable_list/store';
import mockData from '../services/mock_data';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('Ci variable table', () => {
let wrapper;
......@@ -16,7 +16,6 @@ describe('Ci variable table', () => {
jest.spyOn(store, 'dispatch').mockImplementation();
wrapper = mount(CiVariableTable, {
attachTo: document.body,
localVue,
store,
});
};
......
import { GlToggle, GlButton } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import IntegrationForm from '~/clusters/forms/components/integration_form.vue';
import { createStore } from '~/clusters/forms/stores/index';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('ClusterIntegrationForm', () => {
let wrapper;
......@@ -19,7 +19,6 @@ describe('ClusterIntegrationForm', () => {
const createWrapper = (storeValues = defaultStoreValues) => {
wrapper = shallowMount(IntegrationForm, {
localVue,
store: createStore(storeValues),
provide: {
autoDevopsHelpPath: 'topics/autodevops/index',
......
import { GlCard, GlLoadingIcon, GlButton, GlSprintf, GlBadge } from '@gitlab/ui';
import { createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import ClustersViewAll from '~/clusters_list/components/clusters_view_all.vue';
......@@ -16,8 +16,7 @@ import {
} from '~/clusters_list/constants';
import { sprintf } from '~/locale';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
const addClusterPath = '/path/to/add/cluster';
const defaultBranchName = 'default-branch';
......@@ -59,7 +58,6 @@ describe('ClustersViewAllComponent', () => {
const createWrapper = ({ initialState }) => {
wrapper = shallowMountExtended(ClustersViewAll, {
localVue,
store: createStore(initialState),
propsData,
provide: provideData,
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import App from '~/code_navigation/components/app.vue';
import Popover from '~/code_navigation/components/popover.vue';
import createState from '~/code_navigation/store/state';
const localVue = createLocalVue();
const fetchData = jest.fn();
const showDefinition = jest.fn();
let wrapper;
localVue.use(Vuex);
Vue.use(Vuex);
function factory(initialState = {}) {
const store = new Vuex.Store({
......@@ -24,7 +24,7 @@ function factory(initialState = {}) {
},
});
wrapper = shallowMount(App, { store, localVue });
wrapper = shallowMount(App, { store });
}
describe('Code navigation app component', () => {
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import CreateEksCluster from '~/create_cluster/eks_cluster/components/create_eks_cluster.vue';
import EksClusterConfigurationForm from '~/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue';
import ServiceCredentialsForm from '~/create_cluster/eks_cluster/components/service_credentials_form.vue';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('CreateEksCluster', () => {
let vm;
......@@ -33,7 +33,6 @@ describe('CreateEksCluster', () => {
externalLinkIcon,
kubernetesIntegrationHelpPath,
},
localVue,
store,
});
});
......
import { GlFormCheckbox } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
......@@ -7,8 +7,7 @@ import EksClusterConfigurationForm from '~/create_cluster/eks_cluster/components
import eksClusterFormState from '~/create_cluster/eks_cluster/store/state';
import clusterDropdownStoreState from '~/create_cluster/store/cluster_dropdown/state';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('EksClusterConfigurationForm', () => {
let store;
......@@ -151,7 +150,6 @@ describe('EksClusterConfigurationForm', () => {
const buildWrapper = () => {
vm = shallowMount(EksClusterConfigurationForm, {
localVue,
store,
propsData: {
gitlabManagedClusterHelpPath: '',
......
import { GlButton } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import ServiceCredentialsForm from '~/create_cluster/eks_cluster/components/service_credentials_form.vue';
import eksClusterState from '~/create_cluster/eks_cluster/store/state';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('ServiceCredentialsForm', () => {
let vm;
......@@ -33,7 +33,6 @@ describe('ServiceCredentialsForm', () => {
createRoleArnHelpPath: '',
externalLinkIcon: '',
},
localVue,
store,
});
});
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import GkeMachineTypeDropdown from '~/create_cluster/gke_cluster/components/gke_machine_type_dropdown.vue';
import createState from '~/create_cluster/gke_cluster/store/state';
......@@ -19,15 +20,12 @@ const LABELS = {
DEFAULT: 'Select machine type',
};
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
const createComponent = (store, propsData = componentConfig) =>
shallowMount(GkeMachineTypeDropdown, {
propsData,
store,
localVue,
});
const createStore = (initialState = {}, getters = {}) =>
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import ClusterFormDropdown from '~/create_cluster/components/cluster_form_dropdown.vue';
import GkeNetworkDropdown from '~/create_cluster/gke_cluster/components/gke_network_dropdown.vue';
import createClusterDropdownState from '~/create_cluster/store/cluster_dropdown/state';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('GkeNetworkDropdown', () => {
let wrapper;
......@@ -54,7 +53,6 @@ describe('GkeNetworkDropdown', () => {
shallowMount(GkeNetworkDropdown, {
propsData,
store,
localVue,
});
afterEach(() => {
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import GkeProjectIdDropdown from '~/create_cluster/gke_cluster/components/gke_project_id_dropdown.vue';
import createState from '~/create_cluster/gke_cluster/store/state';
......@@ -19,9 +20,7 @@ const LABELS = {
EMPTY: 'No projects found',
};
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('GkeProjectIdDropdown', () => {
let wrapper;
......@@ -52,7 +51,6 @@ describe('GkeProjectIdDropdown', () => {
shallowMount(GkeProjectIdDropdown, {
propsData,
store,
localVue,
});
const bootstrap = (initialState, getters) => {
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import GkeSubmitButton from '~/create_cluster/gke_cluster/components/gke_submit_button.vue';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('GkeSubmitButton', () => {
let wrapper;
......@@ -21,7 +20,6 @@ describe('GkeSubmitButton', () => {
const buildWrapper = () =>
shallowMount(GkeSubmitButton, {
store,
localVue,
});
const bootstrap = () => {
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import ClusterFormDropdown from '~/create_cluster/components/cluster_form_dropdown.vue';
import GkeSubnetworkDropdown from '~/create_cluster/gke_cluster/components/gke_subnetwork_dropdown.vue';
import createClusterDropdownState from '~/create_cluster/store/cluster_dropdown/state';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('GkeSubnetworkDropdown', () => {
let wrapper;
......@@ -41,7 +40,6 @@ describe('GkeSubnetworkDropdown', () => {
shallowMount(GkeSubnetworkDropdown, {
propsData,
store,
localVue,
});
afterEach(() => {
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import Vuex from 'vuex';
......@@ -15,8 +16,7 @@ import * as utils from '~/vue_shared/components/filtered_search_bar/filtered_sea
import initialFiltersState from '~/vue_shared/components/filtered_search_bar/store/modules/filters/state';
import UrlSync from '~/vue_shared/components/url_sync.vue';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
const milestoneTokenType = 'milestone';
const labelsTokenType = 'labels';
......@@ -77,7 +77,6 @@ describe('Filter bar', () => {
const createComponent = (initialStore) => {
return shallowMount(FilterBar, {
localVue,
store: initialStore,
propsData: {
groupPath: 'foo',
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import DeployFreezeModal from '~/deploy_freeze/components/deploy_freeze_modal.vue';
import DeployFreezeSettings from '~/deploy_freeze/components/deploy_freeze_settings.vue';
......@@ -6,8 +7,7 @@ import DeployFreezeTable from '~/deploy_freeze/components/deploy_freeze_table.vu
import createStore from '~/deploy_freeze/store';
import { timezoneDataFixture } from '../helpers';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('Deploy freeze settings', () => {
let wrapper;
......@@ -20,7 +20,6 @@ describe('Deploy freeze settings', () => {
});
jest.spyOn(store, 'dispatch').mockImplementation();
wrapper = shallowMount(DeployFreezeSettings, {
localVue,
store,
});
});
......
import { GlModal } from '@gitlab/ui';
import { createLocalVue, mount } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import DeployFreezeTable from '~/deploy_freeze/components/deploy_freeze_table.vue';
import createStore from '~/deploy_freeze/store';
import { RECEIVE_FREEZE_PERIODS_SUCCESS } from '~/deploy_freeze/store/mutation_types';
import { freezePeriodsFixture, timezoneDataFixture } from '../helpers';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('Deploy freeze table', () => {
let wrapper;
......@@ -21,7 +21,6 @@ describe('Deploy freeze table', () => {
jest.spyOn(store, 'dispatch').mockImplementation();
wrapper = mount(DeployFreezeTable, {
attachTo: document.body,
localVue,
store,
});
};
......
import { GlDropdownItem, GlDropdown } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import createStore from '~/deploy_freeze/store';
import TimezoneDropdown from '~/vue_shared/components/timezone_dropdown.vue';
import { findTzByName, formatTz, timezoneDataFixture } from '../helpers';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('Deploy freeze timezone dropdown', () => {
let wrapper;
......@@ -19,7 +19,6 @@ describe('Deploy freeze timezone dropdown', () => {
});
wrapper = shallowMount(TimezoneDropdown, {
store,
localVue,
propsData: {
value: selectedTimezone,
timezoneData: timezoneDataFixture,
......
import { GlIcon, GlLoadingIcon, GlIntersectionObserver } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueRouter from 'vue-router';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import Item from '~/design_management/components/list/item.vue';
const localVue = createLocalVue();
localVue.use(VueRouter);
Vue.use(VueRouter);
const router = new VueRouter();
// Referenced from: gitlab_schema.graphql:DesignVersionEvent
......@@ -34,7 +34,6 @@ describe('Design management list item component', () => {
} = {}) {
wrapper = extendedWrapper(
shallowMount(Item, {
localVue,
router,
propsData: {
id: imgId,
......
import { GlButton } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueRouter from 'vue-router';
import DeleteButton from '~/design_management/components/delete_button.vue';
import Toolbar from '~/design_management/components/toolbar/index.vue';
import { DESIGNS_ROUTE_NAME } from '~/design_management/router/constants';
const localVue = createLocalVue();
localVue.use(VueRouter);
Vue.use(VueRouter);
const router = new VueRouter();
const RouterLinkStub = {
......@@ -28,7 +28,6 @@ describe('Design management toolbar component', () => {
updatedAt.setHours(updatedAt.getHours() - 1);
wrapper = shallowMount(Toolbar, {
localVue,
router,
propsData: {
id: '1',
......
import { GlAlert } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import { ApolloMutation } from 'vue-apollo';
import VueRouter from 'vue-router';
import { mockTracking, unmockTracking } from 'helpers/tracking_helper';
......@@ -78,8 +79,7 @@ const createDiscussionMutationVariables = {
},
};
const localVue = createLocalVue();
localVue.use(VueRouter);
Vue.use(VueRouter);
describe('Design management design index page', () => {
let wrapper;
......@@ -128,7 +128,6 @@ describe('Design management design index page', () => {
...data,
};
},
localVue,
router,
});
}
......
import { mount, createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue';
import { mount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueRouter from 'vue-router';
import App from '~/design_management/components/app.vue';
import DesignDetail from '~/design_management/pages/design/index.vue';
......@@ -9,8 +9,7 @@ import { DESIGNS_ROUTE_NAME, DESIGN_ROUTE_NAME } from '~/design_management/route
import '~/commons/bootstrap';
function factory(routeArg) {
const localVue = createLocalVue();
localVue.use(VueRouter);
Vue.use(VueRouter);
window.gon = { sprite_icons: '' };
......@@ -20,7 +19,6 @@ function factory(routeArg) {
}
return mount(App, {
localVue,
router,
mocks: {
$apollo: {
......
import { shallowMount, mount, createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue';
import { shallowMount, mount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import Vuex from 'vuex';
import CollapsedFilesWarning from '~/diffs/components/collapsed_files_warning.vue';
import { CENTERED_LIMITED_CONTAINER_CLASSES, EVT_EXPAND_ALL_FILES } from '~/diffs/constants';
......@@ -23,11 +23,10 @@ async function files(store, count) {
}
describe('CollapsedFilesWarning', () => {
const localVue = createLocalVue();
let store;
let wrapper;
localVue.use(Vuex);
Vue.use(Vuex);
const getAlertActionButton = () =>
wrapper.find(CollapsedFilesWarning).find('button.gl-alert-action:first-child');
......@@ -43,7 +42,6 @@ describe('CollapsedFilesWarning', () => {
wrapper = mounter(CollapsedFilesWarning, {
propsData: { ...propsData, ...props },
localVue,
store,
});
};
......
import { mount, createLocalVue } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import getDiffWithCommit from 'test_fixtures/merge_request_diffs/with_commit.json';
import setWindowLocation from 'helpers/set_window_location_helper';
......@@ -8,8 +9,7 @@ import CompareVersionsComponent from '~/diffs/components/compare_versions.vue';
import { createStore } from '~/mr_notes/stores';
import diffsMockData from '../mock_data/merge_request_diffs';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
const NEXT_COMMIT_URL = `${TEST_HOST}/?commit_id=next`;
const PREV_COMMIT_URL = `${TEST_HOST}/?commit_id=prev`;
......@@ -30,7 +30,6 @@ describe('CompareVersions', () => {
}
wrapper = mount(CompareVersionsComponent, {
localVue,
store,
propsData: {
mergeRequestDiffs: diffsMockData,
......
import { GlLoadingIcon } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import DiffContentComponent from '~/diffs/components/diff_content.vue';
import DiffDiscussions from '~/diffs/components/diff_discussions.vue';
......@@ -11,8 +12,7 @@ import NoPreviewViewer from '~/vue_shared/components/diff_viewer/viewers/no_prev
import NotDiffableViewer from '~/vue_shared/components/diff_viewer/viewers/not_diffable.vue';
import diffFileMockData from '../mock_data/diff_file';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('DiffContent', () => {
let wrapper;
......@@ -88,7 +88,6 @@ describe('DiffContent', () => {
...defaultProps,
...props,
},
localVue,
store: fakeStore,
provide: { glFeatures },
});
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import DiffDiscussionReply from '~/diffs/components/diff_discussion_reply.vue';
import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue';
import NoteSignedOutWidget from '~/notes/components/note_signed_out_widget.vue';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('DiffDiscussionReply', () => {
let wrapper;
......@@ -15,7 +15,6 @@ describe('DiffDiscussionReply', () => {
const createComponent = (props = {}, slots = {}) => {
wrapper = shallowMount(DiffDiscussionReply, {
store,
localVue,
propsData: {
...props,
},
......
import { GlIcon } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import DiffDiscussions from '~/diffs/components/diff_discussions.vue';
import { createStore } from '~/mr_notes/stores';
import DiscussionNotes from '~/notes/components/discussion_notes.vue';
......@@ -8,8 +8,6 @@ import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item
import '~/behaviors/markdown/render_gfm';
import discussionsMockData from '../mock_data/diff_discussions';
const localVue = createLocalVue();
describe('DiffDiscussions', () => {
let store;
let wrapper;
......@@ -17,13 +15,12 @@ describe('DiffDiscussions', () => {
const createComponent = (props) => {
store = createStore();
wrapper = mount(localVue.extend(DiffDiscussions), {
wrapper = mount(DiffDiscussions, {
store,
propsData: {
discussions: getDiscussionsMockData(),
...props,
},
localVue,
});
};
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import { cloneDeep } from 'lodash';
import Vuex from 'vuex';
......@@ -37,8 +38,7 @@ const diffFile = Object.freeze(
}),
);
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('DiffFileHeader component', () => {
let wrapper;
......@@ -103,7 +103,6 @@ describe('DiffFileHeader component', () => {
...props,
},
...options,
localVue,
store,
});
};
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import { nextTick } from 'vue';
import Vue, { nextTick } from 'vue';
import Vuex from 'vuex';
import DiffContentComponent from 'jh_else_ce/diffs/components/diff_content.vue';
......@@ -70,9 +70,7 @@ function markFileToBeRendered(store, index = 0) {
}
function createComponent({ file, first = false, last = false, options = {}, props = {} }) {
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
const store = new Vuex.Store({
...createNotesStore(),
......@@ -85,7 +83,6 @@ function createComponent({ file, first = false, last = false, options = {}, prop
const wrapper = shallowMount(DiffFileComponent, {
store,
localVue,
propsData: {
file,
canCurrentUserFork: false,
......@@ -98,7 +95,6 @@ function createComponent({ file, first = false, last = false, options = {}, prop
});
return {
localVue,
wrapper,
store,
};
......
import { GlButton } from '@gitlab/ui';
import { createLocalVue, shallowMount, mount } from '@vue/test-utils';
import { shallowMount, mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import NoChanges from '~/diffs/components/no_changes.vue';
import { createStore } from '~/mr_notes/stores';
import diffsMockData from '../mock_data/merge_request_diffs';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
const TEST_TARGET_BRANCH = 'foo';
const TEST_SOURCE_BRANCH = 'dev/update';
......@@ -17,7 +17,6 @@ describe('Diff no changes empty state', () => {
function createComponent(mountFn = shallowMount) {
wrapper = mountFn(NoChanges, {
localVue,
store,
propsData: {
changesEmptyStateIllustration: '',
......
import { shallowMount, mount, createLocalVue } from '@vue/test-utils';
import { shallowMount, mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import TreeList from '~/diffs/components/tree_list.vue';
import createStore from '~/diffs/store/modules';
......@@ -8,13 +9,11 @@ describe('Diffs tree list component', () => {
let wrapper;
let store;
const getFileRows = () => wrapper.findAll('.file-row');
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
const createComponent = (mountFn = mount) => {
wrapper = mountFn(TreeList, {
store,
localVue,
propsData: { hideFileStats: false },
});
};
......
......@@ -7,7 +7,8 @@ import {
GlAlert,
GlSprintf,
} from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import {
severityLevel,
......@@ -27,8 +28,7 @@ import Tracking from '~/tracking';
jest.mock('~/flash');
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('ErrorDetails', () => {
let store;
......@@ -53,7 +53,6 @@ describe('ErrorDetails', () => {
function mountComponent() {
wrapper = shallowMount(ErrorDetails, {
stubs: { GlButton, GlSprintf },
localVue,
store,
mocks,
propsData: {
......
import { GlEmptyState, GlLoadingIcon, GlFormInput, GlPagination, GlDropdown } from '@gitlab/ui';
import { createLocalVue, mount } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import stubChildren from 'helpers/stub_children';
import ErrorTrackingActions from '~/error_tracking/components/error_tracking_actions.vue';
......@@ -8,8 +9,7 @@ import { trackErrorListViewsOptions, trackErrorStatusUpdateOptions } from '~/err
import Tracking from '~/tracking';
import errorsList from './list_mock.json';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('ErrorTrackingList', () => {
let store;
......@@ -32,7 +32,6 @@ describe('ErrorTrackingList', () => {
stubs = {},
} = {}) {
wrapper = mount(ErrorTrackingList, {
localVue,
store,
propsData: {
indexPath: '/path',
......
import { GlFormRadioGroup, GlFormRadio, GlFormInputGroup } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import Vuex from 'vuex';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import { TEST_HOST } from 'helpers/test_constants';
......@@ -10,8 +10,7 @@ import ErrorTrackingForm from '~/error_tracking_settings/components/error_tracki
import ProjectDropdown from '~/error_tracking_settings/components/project_dropdown.vue';
import createStore from '~/error_tracking_settings/store';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
const TEST_GITLAB_DSN = 'https://gitlab.example.com/123456';
......@@ -22,7 +21,6 @@ describe('error tracking settings app', () => {
function mountComponent() {
wrapper = extendedWrapper(
shallowMount(ErrorTrackingSettings, {
localVue,
store, // Override the imported store
propsData: {
initialEnabled: 'true',
......
import { GlFormInput, GlButton } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import ErrorTrackingForm from '~/error_tracking_settings/components/error_tracking_form.vue';
import createStore from '~/error_tracking_settings/store';
import { defaultProps } from '../mock';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('error tracking settings form', () => {
let wrapper;
......@@ -14,7 +14,6 @@ describe('error tracking settings form', () => {
function mountComponent() {
wrapper = shallowMount(ErrorTrackingForm, {
localVue,
store,
propsData: defaultProps,
});
......
import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import { pick, clone } from 'lodash';
import Vuex from 'vuex';
import ProjectDropdown from '~/error_tracking_settings/components/project_dropdown.vue';
import { defaultProps, projectList, staleProject } from '../mock';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('error tracking settings project dropdown', () => {
let wrapper;
function mountComponent() {
wrapper = shallowMount(ProjectDropdown, {
localVue,
propsData: {
...pick(
defaultProps,
......
import { GlAlert, GlEmptyState, GlLoadingIcon } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import MockAdapter from 'axios-mock-adapter';
import Vuex from 'vuex';
import waitForPromises from 'helpers/wait_for_promises';
......@@ -13,8 +14,7 @@ import axios from '~/lib/utils/axios_utils';
import TablePagination from '~/vue_shared/components/pagination/table_pagination.vue';
import { getRequestData } from '../mock_data';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('Feature flags', () => {
const mockData = {
......@@ -45,7 +45,6 @@ describe('Feature flags', () => {
const factory = (provide = mockData, fn = mount) => {
store = createStore(mockState);
wrapper = fn(FeatureFlagsComponent, {
localVue,
store,
provide,
stubs: {
......
import { GlAlert } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import { TEST_HOST } from 'spec/test_constants';
import Form from '~/feature_flags/components/form.vue';
......@@ -10,8 +11,7 @@ import { allUsersStrategy } from '../mock_data';
const userCalloutId = 'feature_flags_new_version';
const userCalloutsPath = `${TEST_HOST}/user_callouts`;
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('New feature flag form', () => {
let wrapper;
......@@ -27,7 +27,6 @@ describe('New feature flag form', () => {
wrapper = null;
}
wrapper = shallowMount(NewFeatureFlag, {
localVue,
store,
provide: {
showUserCallout: true,
......
import { GlDropdown, GlDropdownItem, GlSearchBoxByType, GlLoadingIcon } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import Api from '~/api';
import GitlabUserList from '~/feature_flags/components/strategies/gitlab_user_list.vue';
......@@ -12,15 +13,13 @@ const DEFAULT_PROPS = {
strategy: userListStrategy,
};
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('~/feature_flags/components/strategies/gitlab_user_list.vue', () => {
let wrapper;
const factory = (props = {}) =>
mount(GitlabUserList, {
localVue,
store: createStore({ projectId: '1' }),
propsData: { ...DEFAULT_PROPS, ...props },
});
......
import { GlAlert, GlFormSelect, GlLink, GlToken, GlButton } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import { last } from 'lodash';
import Vuex from 'vuex';
import Api from '~/api';
......@@ -26,8 +27,7 @@ const provide = {
environmentsEndpoint: '',
};
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('Feature flags strategy', () => {
let wrapper;
......@@ -48,7 +48,7 @@ describe('Feature flags strategy', () => {
wrapper.destroy();
wrapper = null;
}
wrapper = mount(Strategy, { localVue, store: createStore({ projectId: '1' }), ...opts });
wrapper = mount(Strategy, { store: createStore({ projectId: '1' }), ...opts });
};
beforeEach(() => {
......
import { GlButton } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import { trimText } from 'helpers/text_helper';
import { mockTracking, unmockTracking } from 'helpers/tracking_helper';
......@@ -8,8 +9,7 @@ import { createStore } from '~/frequent_items/store';
import ProjectAvatar from '~/vue_shared/components/project_avatar.vue';
import { mockProject } from '../mock_data';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('FrequentItemsListItemComponent', () => {
let wrapper;
......@@ -40,7 +40,6 @@ describe('FrequentItemsListItemComponent', () => {
provide: {
vuexModule: 'frequentProjects',
},
localVue,
});
};
......
import { mount, createLocalVue } from '@vue/test-utils';
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import frequentItemsListComponent from '~/frequent_items/components/frequent_items_list.vue';
import frequentItemsListItemComponent from '~/frequent_items/components/frequent_items_list_item.vue';
import { createStore } from '~/frequent_items/store';
import { mockFrequentProjects } from '../mock_data';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('FrequentItemsListComponent', () => {
let wrapper;
......@@ -22,7 +22,6 @@ describe('FrequentItemsListComponent', () => {
matcher: 'lab',
...props,
},
localVue,
provide: {
vuexModule: 'frequentProjects',
},
......
import { GlSearchBoxByType } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import { mockTracking, unmockTracking } from 'helpers/tracking_helper';
import searchComponent from '~/frequent_items/components/frequent_items_search_input.vue';
import { createStore } from '~/frequent_items/store';
const localVue = createLocalVue();
localVue.use(Vuex);
Vue.use(Vuex);
describe('FrequentItemsSearchInputComponent', () => {
let wrapper;
......@@ -18,7 +18,6 @@ describe('FrequentItemsSearchInputComponent', () => {
shallowMount(searchComponent, {
store,
propsData: { namespace },
localVue,
provide: {
vuexModule: 'frequentProjects',
},
......
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