Commit 69cb7a22 authored by Andrew Fontaine's avatar Andrew Fontaine

Remove localVue Usage from Feature Flag Tests

They aren't being used, and aren't necessary in Jest.
parent 858555fa
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/feature_flags/components/configure_feature_flags_modal.vue'; import Component from 'ee/feature_flags/components/configure_feature_flags_modal.vue';
const localVue = createLocalVue();
describe('Configure Feature Flags Modal', () => { describe('Configure Feature Flags Modal', () => {
const Component = localVue.extend(component);
let wrapper; let wrapper;
let propsData; let propsData;
...@@ -24,7 +21,6 @@ describe('Configure Feature Flags Modal', () => { ...@@ -24,7 +21,6 @@ describe('Configure Feature Flags Modal', () => {
wrapper = shallowMount(Component, { wrapper = shallowMount(Component, {
propsData, propsData,
localVue,
sync: false, sync: false,
attachToDocument: true, attachToDocument: true,
}); });
......
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlLoadingIcon, GlButton } from '@gitlab/ui'; import { GlLoadingIcon, GlButton } from '@gitlab/ui';
import EnvironmentsDropdown from 'ee/feature_flags/components/environments_dropdown.vue'; import EnvironmentsDropdown from 'ee/feature_flags/components/environments_dropdown.vue';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
const localVue = createLocalVue();
describe('Feature flags > Environments dropdown ', () => { describe('Feature flags > Environments dropdown ', () => {
let wrapper; let wrapper;
let mock; let mock;
const factory = props => { const factory = props => {
wrapper = shallowMount(EnvironmentsDropdown, { wrapper = shallowMount(EnvironmentsDropdown, {
localVue,
propsData: { propsData: {
endpoint: `${TEST_HOST}/environments.json'`, endpoint: `${TEST_HOST}/environments.json'`,
...props, ...props,
......
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { GlEmptyState, GlLoadingIcon } from '@gitlab/ui'; import { GlEmptyState, GlLoadingIcon } from '@gitlab/ui';
import store from 'ee/feature_flags/store'; import store from 'ee/feature_flags/store';
...@@ -11,8 +11,6 @@ import TablePagination from '~/vue_shared/components/pagination/table_pagination ...@@ -11,8 +11,6 @@ import TablePagination from '~/vue_shared/components/pagination/table_pagination
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { getRequestData } from '../mock_data'; import { getRequestData } from '../mock_data';
const localVue = createLocalVue();
describe('Feature flags', () => { describe('Feature flags', () => {
const mockData = { const mockData = {
endpoint: `${TEST_HOST}/endpoint.json`, endpoint: `${TEST_HOST}/endpoint.json`,
...@@ -32,7 +30,6 @@ describe('Feature flags', () => { ...@@ -32,7 +30,6 @@ describe('Feature flags', () => {
const factory = (propsData = mockData) => { const factory = (propsData = mockData) => {
wrapper = shallowMount(FeatureFlagsComponent, { wrapper = shallowMount(FeatureFlagsComponent, {
localVue,
propsData, propsData,
sync: false, sync: false,
}); });
...@@ -148,7 +145,7 @@ describe('Feature flags', () => { ...@@ -148,7 +145,7 @@ describe('Feature flags', () => {
it('renders disabled title', () => { it('renders disabled title', () => {
wrapper.setData({ scope: 'disabled' }); wrapper.setData({ scope: 'disabled' });
return localVue.nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(emptyState.props('title')).toEqual('There are no inactive feature flags'); expect(emptyState.props('title')).toEqual('There are no inactive feature flags');
}); });
}); });
...@@ -158,7 +155,7 @@ describe('Feature flags', () => { ...@@ -158,7 +155,7 @@ describe('Feature flags', () => {
it('renders enabled title', () => { it('renders enabled title', () => {
wrapper.setData({ scope: 'enabled' }); wrapper.setData({ scope: 'enabled' });
localVue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(emptyState.props('title')).toEqual('There are no active feature flags'); expect(emptyState.props('title')).toEqual('There are no active feature flags');
}); });
}); });
......
import FeatureFlagsTable from 'ee/feature_flags/components/feature_flags_table.vue'; import FeatureFlagsTable from 'ee/feature_flags/components/feature_flags_table.vue';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlToggle } from '@gitlab/ui'; import { GlToggle } from '@gitlab/ui';
import { trimText } from 'helpers/text_helper'; import { trimText } from 'helpers/text_helper';
import { import {
...@@ -8,8 +8,6 @@ import { ...@@ -8,8 +8,6 @@ import {
DEFAULT_PERCENT_ROLLOUT, DEFAULT_PERCENT_ROLLOUT,
} from 'ee/feature_flags/constants'; } from 'ee/feature_flags/constants';
const localVue = createLocalVue();
const getDefaultProps = () => ({ const getDefaultProps = () => ({
featureFlags: [ featureFlags: [
{ {
...@@ -44,7 +42,6 @@ describe('Feature flag table', () => { ...@@ -44,7 +42,6 @@ describe('Feature flag table', () => {
wrapper = shallowMount(FeatureFlagsTable, { wrapper = shallowMount(FeatureFlagsTable, {
propsData, propsData,
sync: false, sync: false,
localVue,
...opts, ...opts,
}); });
}; };
......
import _ from 'underscore'; import _ from 'underscore';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlFormTextarea, GlFormCheckbox } from '@gitlab/ui'; import { GlFormTextarea, GlFormCheckbox } from '@gitlab/ui';
import Form from 'ee/feature_flags/components/form.vue'; import Form from 'ee/feature_flags/components/form.vue';
import EnvironmentsDropdown from 'ee/feature_flags/components/environments_dropdown.vue'; import EnvironmentsDropdown from 'ee/feature_flags/components/environments_dropdown.vue';
...@@ -31,10 +31,7 @@ describe('feature flag form', () => { ...@@ -31,10 +31,7 @@ describe('feature flag form', () => {
}); });
const factory = (props = {}) => { const factory = (props = {}) => {
const localVue = createLocalVue();
wrapper = shallowMount(Form, { wrapper = shallowMount(Form, {
localVue,
propsData: props, propsData: props,
provide: { provide: {
glFeatures: { glFeatures: {
......
import Vuex from 'vuex'; import Vuex from 'vuex';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Form from 'ee/feature_flags/components/form.vue'; import Form from 'ee/feature_flags/components/form.vue';
import newModule from 'ee/feature_flags/store/modules/new'; import newModule from 'ee/feature_flags/store/modules/new';
import NewFeatureFlag from 'ee/feature_flags/components/new_feature_flag.vue'; import NewFeatureFlag from 'ee/feature_flags/components/new_feature_flag.vue';
import { ROLLOUT_STRATEGY_ALL_USERS, DEFAULT_PERCENT_ROLLOUT } from 'ee/feature_flags/constants'; import { ROLLOUT_STRATEGY_ALL_USERS, DEFAULT_PERCENT_ROLLOUT } from 'ee/feature_flags/constants';
const localVue = createLocalVue();
localVue.use(Vuex);
describe('New feature flag form', () => { describe('New feature flag form', () => {
let wrapper; let wrapper;
...@@ -19,7 +16,6 @@ describe('New feature flag form', () => { ...@@ -19,7 +16,6 @@ describe('New feature flag form', () => {
const factory = () => { const factory = () => {
wrapper = shallowMount(NewFeatureFlag, { wrapper = shallowMount(NewFeatureFlag, {
localVue,
propsData: { propsData: {
endpoint: 'feature_flags.json', endpoint: 'feature_flags.json',
path: '/feature_flags', path: '/feature_flags',
......
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