Commit 1a25d44e authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'feature-flag-toggle-on-table-poc' into 'master'

Remove localVue Usage from Feature Flag Tests

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