Commit c7ea0aca authored by Jason Goodman's avatar Jason Goodman Committed by Andrew Fontaine

Move feature flags frontend to core

Part of moving feature flags to core
parent a51d95a0
......@@ -65,6 +65,8 @@ const Api = {
tagsPath: '/api/:version/projects/:id/repository/tags',
freezePeriodsPath: '/api/:version/projects/:id/freeze_periods',
usageDataIncrementUniqueUsersPath: '/api/:version/usage_data/increment_unique_users',
featureFlagUserLists: '/api/:version/projects/:id/feature_flags_user_lists',
featureFlagUserList: '/api/:version/projects/:id/feature_flags_user_lists/:list_iid',
group(groupId, callback = () => {}) {
const url = Api.buildUrl(Api.groupPath).replace(':id', groupId);
......@@ -709,6 +711,42 @@ const Api = {
buildUrl(url) {
return joinPaths(gon.relative_url_root || '', url.replace(':version', gon.api_version));
},
fetchFeatureFlagUserLists(id, page) {
const url = Api.buildUrl(this.featureFlagUserLists).replace(':id', id);
return axios.get(url, { params: { page } });
},
createFeatureFlagUserList(id, list) {
const url = Api.buildUrl(this.featureFlagUserLists).replace(':id', id);
return axios.post(url, list);
},
fetchFeatureFlagUserList(id, listIid) {
const url = Api.buildUrl(this.featureFlagUserList)
.replace(':id', id)
.replace(':list_iid', listIid);
return axios.get(url);
},
updateFeatureFlagUserList(id, list) {
const url = Api.buildUrl(this.featureFlagUserList)
.replace(':id', id)
.replace(':list_iid', list.iid);
return axios.put(url, list);
},
deleteFeatureFlagUserList(id, listIid) {
const url = Api.buildUrl(this.featureFlagUserList)
.replace(':id', id)
.replace(':list_iid', listIid);
return axios.delete(url);
},
};
export default Api;
......@@ -11,7 +11,7 @@ import {
GlSprintf,
GlIcon,
} from '@gitlab/ui';
import Api from 'ee/api';
import Api from '~/api';
import RelatedIssuesRoot from '~/related_issues/components/related_issues_root.vue';
import { s__ } from '~/locale';
import { deprecatedCreateFlash as flash, FLASH_TYPES } from '~/flash';
......
import Vue from 'vue';
import EditFeatureFlag from 'ee/feature_flags/components/edit_feature_flag.vue';
import EditFeatureFlag from '~/feature_flags/components/edit_feature_flag.vue';
import { parseBoolean } from '~/lib/utils/common_utils';
export default () => {
......
import Vue from 'vue';
import FeatureFlagsComponent from 'ee/feature_flags/components/feature_flags.vue';
import FeatureFlagsComponent from '~/feature_flags/components/feature_flags.vue';
import csrf from '~/lib/utils/csrf';
export default () =>
......
import Vue from 'vue';
import NewFeatureFlag from 'ee/feature_flags/components/new_feature_flag.vue';
import NewFeatureFlag from '~/feature_flags/components/new_feature_flag.vue';
import { parseBoolean } from '~/lib/utils/common_utils';
export default () => {
......
import Api from 'ee/api';
import Api from '~/api';
import * as types from './mutation_types';
import axios from '~/lib/utils/axios_utils';
......
import initEditFeatureFlags from 'ee/feature_flags/edit';
import initEditFeatureFlags from '~/feature_flags/edit';
document.addEventListener('DOMContentLoaded', initEditFeatureFlags);
import initFeatureFlags from 'ee/feature_flags';
import initFeatureFlags from '~/feature_flags';
document.addEventListener('DOMContentLoaded', initFeatureFlags);
import initNewFeatureFlags from 'ee/feature_flags/new';
import initNewFeatureFlags from '~/feature_flags/new';
document.addEventListener('DOMContentLoaded', initNewFeatureFlags);
import Vue from 'vue';
import Vuex from 'vuex';
import EditUserList from 'ee/user_lists/components/edit_user_list.vue';
import createStore from 'ee/user_lists/store/edit';
import EditUserList from '~/user_lists/components/edit_user_list.vue';
import createStore from '~/user_lists/store/edit';
Vue.use(Vuex);
......
import Vue from 'vue';
import Vuex from 'vuex';
import NewUserList from 'ee/user_lists/components/new_user_list.vue';
import createStore from 'ee/user_lists/store/new';
import NewUserList from '~/user_lists/components/new_user_list.vue';
import createStore from '~/user_lists/store/new';
Vue.use(Vuex);
......
import Vue from 'vue';
import Vuex from 'vuex';
import UserList from 'ee/user_lists/components/user_list.vue';
import createStore from 'ee/user_lists/store/show';
import UserList from '~/user_lists/components/user_list.vue';
import createStore from '~/user_lists/store/show';
Vue.use(Vuex);
......
import Api from 'ee/api';
import Api from '~/api';
import { redirectTo } from '~/lib/utils/url_utility';
import { getErrorMessages } from '../utils';
import * as types from './mutation_types';
......
import Api from 'ee/api';
import Api from '~/api';
import { redirectTo } from '~/lib/utils/url_utility';
import { getErrorMessages } from '../utils';
import * as types from './mutation_types';
......
import Api from 'ee/api';
import Api from '~/api';
import { stringifyUserIds } from '../utils';
import * as types from './mutation_types';
......
......@@ -40,8 +40,6 @@ export default {
vulnerabilityPath: '/api/:version/vulnerabilities/:id',
vulnerabilityActionPath: '/api/:version/vulnerabilities/:id/:action',
vulnerabilityIssueLinksPath: '/api/:version/vulnerabilities/:id/issue_links',
featureFlagUserLists: '/api/:version/projects/:id/feature_flags_user_lists',
featureFlagUserList: '/api/:version/projects/:id/feature_flags_user_lists/:list_iid',
applicationSettingsPath: '/api/:version/application/settings',
userSubscription(namespaceId) {
......@@ -318,42 +316,6 @@ export default {
return axios.put(`${url}/${node.id}`, node);
},
fetchFeatureFlagUserLists(id, page) {
const url = Api.buildUrl(this.featureFlagUserLists).replace(':id', id);
return axios.get(url, { params: { page } });
},
createFeatureFlagUserList(id, list) {
const url = Api.buildUrl(this.featureFlagUserLists).replace(':id', id);
return axios.post(url, list);
},
fetchFeatureFlagUserList(id, listIid) {
const url = Api.buildUrl(this.featureFlagUserList)
.replace(':id', id)
.replace(':list_iid', listIid);
return axios.get(url);
},
updateFeatureFlagUserList(id, list) {
const url = Api.buildUrl(this.featureFlagUserList)
.replace(':id', id)
.replace(':list_iid', list.iid);
return axios.put(url, list);
},
deleteFeatureFlagUserList(id, listIid) {
const url = Api.buildUrl(this.featureFlagUserList)
.replace(':id', id)
.replace(':list_iid', listIid);
return axios.delete(url);
},
getApplicationSettings() {
const url = Api.buildUrl(this.applicationSettingsPath);
return axios.get(url);
......
import { shallowMount } from '@vue/test-utils';
import { GlModal, GlSprintf } from '@gitlab/ui';
import Component from 'ee/feature_flags/components/configure_feature_flags_modal.vue';
import Component from '~/feature_flags/components/configure_feature_flags_modal.vue';
import Callout from '~/vue_shared/components/callout.vue';
describe('Configure Feature Flags Modal', () => {
......
......@@ -2,12 +2,12 @@ import Vuex from 'vuex';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import { GlToggle, GlAlert } from '@gitlab/ui';
import { LEGACY_FLAG, NEW_VERSION_FLAG, NEW_FLAG_ALERT } from 'ee/feature_flags/constants';
import Form from 'ee/feature_flags/components/form.vue';
import editModule from 'ee/feature_flags/store/modules/edit';
import EditFeatureFlag from 'ee/feature_flags/components/edit_feature_flag.vue';
import { TEST_HOST } from 'spec/test_constants';
import { mockTracking } from 'helpers/tracking_helper';
import { LEGACY_FLAG, NEW_VERSION_FLAG, NEW_FLAG_ALERT } from '~/feature_flags/constants';
import Form from '~/feature_flags/components/form.vue';
import editModule from '~/feature_flags/store/modules/edit';
import EditFeatureFlag from '~/feature_flags/components/edit_feature_flag.vue';
import axios from '~/lib/utils/axios_utils';
const localVue = createLocalVue();
......
import MockAdapter from 'axios-mock-adapter';
import { shallowMount } from '@vue/test-utils';
import { GlLoadingIcon, GlDeprecatedButton, GlSearchBoxByType } from '@gitlab/ui';
import EnvironmentsDropdown from 'ee/feature_flags/components/environments_dropdown.vue';
import { TEST_HOST } from 'spec/test_constants';
import waitForPromises from 'helpers/wait_for_promises';
import EnvironmentsDropdown from '~/feature_flags/components/environments_dropdown.vue';
import axios from '~/lib/utils/axios_utils';
import httpStatusCodes from '~/lib/utils/http_status';
......
import { shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import { GlEmptyState, GlLoadingIcon } from '@gitlab/ui';
import Api from 'ee/api';
import { createStore } from 'ee/feature_flags/store';
import FeatureFlagsTab from 'ee/feature_flags/components/feature_flags_tab.vue';
import FeatureFlagsComponent from 'ee/feature_flags/components/feature_flags.vue';
import FeatureFlagsTable from 'ee/feature_flags/components/feature_flags_table.vue';
import UserListsTable from 'ee/feature_flags/components/user_lists_table.vue';
import ConfigureFeatureFlagsModal from 'ee/feature_flags/components/configure_feature_flags_modal.vue';
import { FEATURE_FLAG_SCOPE, USER_LIST_SCOPE } from 'ee/feature_flags/constants';
import { TEST_HOST } from 'spec/test_constants';
import Api from '~/api';
import { createStore } from '~/feature_flags/store';
import FeatureFlagsTab from '~/feature_flags/components/feature_flags_tab.vue';
import FeatureFlagsComponent from '~/feature_flags/components/feature_flags.vue';
import FeatureFlagsTable from '~/feature_flags/components/feature_flags_table.vue';
import UserListsTable from '~/feature_flags/components/user_lists_table.vue';
import ConfigureFeatureFlagsModal from '~/feature_flags/components/configure_feature_flags_modal.vue';
import { FEATURE_FLAG_SCOPE, USER_LIST_SCOPE } from '~/feature_flags/constants';
import TablePagination from '~/vue_shared/components/pagination/table_pagination.vue';
import axios from '~/lib/utils/axios_utils';
import { getRequestData, userList } from '../mock_data';
......
import { mount } from '@vue/test-utils';
import { GlAlert, GlBadge, GlEmptyState, GlLink, GlLoadingIcon, GlTabs } from '@gitlab/ui';
import FeatureFlagsTab from 'ee/feature_flags/components/feature_flags_tab.vue';
import FeatureFlagsTab from '~/feature_flags/components/feature_flags_tab.vue';
const DEFAULT_PROPS = {
title: 'test',
......@@ -19,7 +19,7 @@ const DEFAULT_PROVIDE = {
featureFlagsHelpPagePath: '/help/page/path',
};
describe('ee/feature_flags/components/feature_flags_tab.vue', () => {
describe('feature_flags/components/feature_flags_tab.vue', () => {
let wrapper;
const factory = (props = {}) =>
......
import FeatureFlagsTable from 'ee/feature_flags/components/feature_flags_table.vue';
import { shallowMount } from '@vue/test-utils';
import { GlToggle, GlBadge } from '@gitlab/ui';
import { trimText } from 'helpers/text_helper';
import { mockTracking } from 'helpers/tracking_helper';
import {
ROLLOUT_STRATEGY_ALL_USERS,
ROLLOUT_STRATEGY_PERCENT_ROLLOUT,
......@@ -10,8 +10,8 @@ import {
NEW_VERSION_FLAG,
LEGACY_FLAG,
DEFAULT_PERCENT_ROLLOUT,
} from 'ee/feature_flags/constants';
import { mockTracking } from 'helpers/tracking_helper';
} from '~/feature_flags/constants';
import FeatureFlagsTable from '~/feature_flags/components/feature_flags_table.vue';
const getDefaultProps = () => ({
featureFlags: [
......
import { uniqueId } from 'lodash';
import { shallowMount } from '@vue/test-utils';
import { GlFormTextarea, GlFormCheckbox, GlButton } from '@gitlab/ui';
import Api from 'ee/api';
import Form from 'ee/feature_flags/components/form.vue';
import EnvironmentsDropdown from 'ee/feature_flags/components/environments_dropdown.vue';
import Strategy from 'ee/feature_flags/components/strategy.vue';
import Api from '~/api';
import Form from '~/feature_flags/components/form.vue';
import EnvironmentsDropdown from '~/feature_flags/components/environments_dropdown.vue';
import Strategy from '~/feature_flags/components/strategy.vue';
import {
ROLLOUT_STRATEGY_ALL_USERS,
ROLLOUT_STRATEGY_PERCENT_ROLLOUT,
......@@ -12,12 +12,12 @@ import {
DEFAULT_PERCENT_ROLLOUT,
LEGACY_FLAG,
NEW_VERSION_FLAG,
} from 'ee/feature_flags/constants';
} from '~/feature_flags/constants';
import RelatedIssuesRoot from '~/related_issues/components/related_issues_root.vue';
import ToggleButton from '~/vue_shared/components/toggle_button.vue';
import { featureFlag, userList, allUsersStrategy } from '../mock_data';
jest.mock('ee/api.js');
jest.mock('~/api.js');
describe('feature flag form', () => {
let wrapper;
......
import { shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import { GlLoadingIcon, GlSearchBoxByType, GlDropdownItem } from '@gitlab/ui';
import NewEnvironmentsDropdown from 'ee/feature_flags/components/new_environments_dropdown.vue';
import NewEnvironmentsDropdown from '~/feature_flags/components/new_environments_dropdown.vue';
import axios from '~/lib/utils/axios_utils';
import httpStatusCodes from '~/lib/utils/http_status';
......
......@@ -2,15 +2,15 @@ import Vuex from 'vuex';
import { shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import { GlAlert } from '@gitlab/ui';
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 { TEST_HOST } from 'spec/test_constants';
import Form from '~/feature_flags/components/form.vue';
import newModule from '~/feature_flags/store/modules/new';
import NewFeatureFlag from '~/feature_flags/components/new_feature_flag.vue';
import {
ROLLOUT_STRATEGY_ALL_USERS,
DEFAULT_PERCENT_ROLLOUT,
NEW_FLAG_ALERT,
} from 'ee/feature_flags/constants';
import { TEST_HOST } from 'spec/test_constants';
} from '~/feature_flags/constants';
import axios from '~/lib/utils/axios_utils';
import { allUsersStrategy } from '../mock_data';
......
......@@ -6,9 +6,9 @@ import {
ROLLOUT_STRATEGY_PERCENT_ROLLOUT,
ROLLOUT_STRATEGY_USER_ID,
ROLLOUT_STRATEGY_GITLAB_USER_LIST,
} from 'ee/feature_flags/constants';
import Strategy from 'ee/feature_flags/components/strategy.vue';
import NewEnvironmentsDropdown from 'ee/feature_flags/components/new_environments_dropdown.vue';
} from '~/feature_flags/constants';
import Strategy from '~/feature_flags/components/strategy.vue';
import NewEnvironmentsDropdown from '~/feature_flags/components/new_environments_dropdown.vue';
import { userList } from '../mock_data';
......
import { mount } from '@vue/test-utils';
import * as timeago from 'timeago.js';
import { GlModal } from '@gitlab/ui';
import UserListsTable from 'ee/feature_flags/components/user_lists_table.vue';
import UserListsTable from '~/feature_flags/components/user_lists_table.vue';
import { userList } from '../mock_data';
jest.mock('timeago.js', () => ({
......
import {
ROLLOUT_STRATEGY_ALL_USERS,
ROLLOUT_STRATEGY_PERCENT_ROLLOUT,
} from 'ee/feature_flags/constants';
} from '~/feature_flags/constants';
export const featureFlag = {
id: 1,
......
import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper';
import { TEST_HOST } from 'spec/test_constants';
import {
setEndpoint,
setPath,
......@@ -11,20 +13,18 @@ import {
receiveFeatureFlagSuccess,
receiveFeatureFlagError,
toggleActive,
} from 'ee/feature_flags/store/modules/edit/actions';
import state from 'ee/feature_flags/store/modules/edit/state';
} from '~/feature_flags/store/modules/edit/actions';
import state from '~/feature_flags/store/modules/edit/state';
import {
mapStrategiesToRails,
mapFromScopesViewModel,
} from 'ee/feature_flags/store/modules/helpers';
} from '~/feature_flags/store/modules/helpers';
import {
NEW_VERSION_FLAG,
LEGACY_FLAG,
ROLLOUT_STRATEGY_ALL_USERS,
} from 'ee/feature_flags/constants';
import * as types from 'ee/feature_flags/store/modules/edit/mutation_types';
import testAction from 'helpers/vuex_action_helper';
import { TEST_HOST } from 'spec/test_constants';
} from '~/feature_flags/constants';
import * as types from '~/feature_flags/store/modules/edit/mutation_types';
import axios from '~/lib/utils/axios_utils';
jest.mock('~/lib/utils/url_utility');
......
import state from 'ee/feature_flags/store/modules/edit/state';
import mutations from 'ee/feature_flags/store/modules/edit/mutations';
import * as types from 'ee/feature_flags/store/modules/edit/mutation_types';
import state from '~/feature_flags/store/modules/edit/state';
import mutations from '~/feature_flags/store/modules/edit/mutations';
import * as types from '~/feature_flags/store/modules/edit/mutation_types';
describe('Feature flags Edit Module Mutations', () => {
let stateCopy;
......
......@@ -5,7 +5,7 @@ import {
createNewEnvironmentScope,
mapStrategiesToViewModel,
mapStrategiesToRails,
} from 'ee/feature_flags/store/modules/helpers';
} from '~/feature_flags/store/modules/helpers';
import {
ROLLOUT_STRATEGY_ALL_USERS,
ROLLOUT_STRATEGY_PERCENT_ROLLOUT,
......@@ -15,7 +15,7 @@ import {
DEFAULT_PERCENT_ROLLOUT,
LEGACY_FLAG,
NEW_VERSION_FLAG,
} from 'ee/feature_flags/constants';
} from '~/feature_flags/constants';
describe('feature flags helpers spec', () => {
describe('mapToScopesViewModel', () => {
......
import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper';
import { TEST_HOST } from 'spec/test_constants';
import Api from '~/api';
import {
requestFeatureFlags,
receiveFeatureFlagsSuccess,
......@@ -23,17 +26,14 @@ import {
deleteUserList,
receiveDeleteUserListError,
clearAlert,
} from 'ee/feature_flags/store/modules/index/actions';
import { mapToScopesViewModel } from 'ee/feature_flags/store/modules/helpers';
import state from 'ee/feature_flags/store/modules/index/state';
import * as types from 'ee/feature_flags/store/modules/index/mutation_types';
import testAction from 'helpers/vuex_action_helper';
import { TEST_HOST } from 'spec/test_constants';
import Api from 'ee/api';
} from '~/feature_flags/store/modules/index/actions';
import { mapToScopesViewModel } from '~/feature_flags/store/modules/helpers';
import state from '~/feature_flags/store/modules/index/state';
import * as types from '~/feature_flags/store/modules/index/mutation_types';
import axios from '~/lib/utils/axios_utils';
import { getRequestData, rotateData, featureFlag, userList } from '../../mock_data';
jest.mock('ee/api.js');
jest.mock('~/api.js');
describe('Feature flags actions', () => {
let mockedState;
......
import state from 'ee/feature_flags/store/modules/index/state';
import mutations from 'ee/feature_flags/store/modules/index/mutations';
import * as types from 'ee/feature_flags/store/modules/index/mutation_types';
import { mapToScopesViewModel } from 'ee/feature_flags/store/modules/helpers';
import state from '~/feature_flags/store/modules/index/state';
import mutations from '~/feature_flags/store/modules/index/mutations';
import * as types from '~/feature_flags/store/modules/index/mutation_types';
import { mapToScopesViewModel } from '~/feature_flags/store/modules/helpers';
import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils';
import { getRequestData, rotateData, featureFlag, userList } from '../../mock_data';
......
import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper';
import { TEST_HOST } from 'spec/test_constants';
import {
setEndpoint,
setPath,
......@@ -6,21 +8,19 @@ import {
requestCreateFeatureFlag,
receiveCreateFeatureFlagSuccess,
receiveCreateFeatureFlagError,
} from 'ee/feature_flags/store/modules/new/actions';
import state from 'ee/feature_flags/store/modules/new/state';
import * as types from 'ee/feature_flags/store/modules/new/mutation_types';
import testAction from 'helpers/vuex_action_helper';
import { TEST_HOST } from 'spec/test_constants';
} from '~/feature_flags/store/modules/new/actions';
import state from '~/feature_flags/store/modules/new/state';
import * as types from '~/feature_flags/store/modules/new/mutation_types';
import {
ROLLOUT_STRATEGY_ALL_USERS,
ROLLOUT_STRATEGY_PERCENT_ROLLOUT,
LEGACY_FLAG,
NEW_VERSION_FLAG,
} from 'ee/feature_flags/constants';
} from '~/feature_flags/constants';
import {
mapFromScopesViewModel,
mapStrategiesToRails,
} from 'ee/feature_flags/store/modules/helpers';
} from '~/feature_flags/store/modules/helpers';
import axios from '~/lib/utils/axios_utils';
jest.mock('~/lib/utils/url_utility');
......
import state from 'ee/feature_flags/store/modules/new/state';
import mutations from 'ee/feature_flags/store/modules/new/mutations';
import * as types from 'ee/feature_flags/store/modules/new/mutation_types';
import state from '~/feature_flags/store/modules/new/state';
import mutations from '~/feature_flags/store/modules/new/mutations';
import * as types from '~/feature_flags/store/modules/new/mutation_types';
describe('Feature flags New Module Mutations', () => {
let stateCopy;
......
import { mount } from '@vue/test-utils';
import AddUserModal from 'ee/user_lists/components/add_user_modal.vue';
import AddUserModal from '~/user_lists/components/add_user_modal.vue';
describe('Add User Modal', () => {
let wrapper;
......
......@@ -2,21 +2,21 @@ import Vue from 'vue';
import Vuex from 'vuex';
import { createLocalVue, mount } from '@vue/test-utils';
import { GlAlert, GlLoadingIcon } from '@gitlab/ui';
import Api from 'ee/api';
import waitForPromises from 'helpers/wait_for_promises';
import createStore from 'ee/user_lists/store/edit';
import EditUserList from 'ee/user_lists/components/edit_user_list.vue';
import UserListForm from 'ee/user_lists/components/user_list_form.vue';
import Api from '~/api';
import createStore from '~/user_lists/store/edit';
import EditUserList from '~/user_lists/components/edit_user_list.vue';
import UserListForm from '~/user_lists/components/user_list_form.vue';
import { userList } from '../../feature_flags/mock_data';
import { redirectTo } from '~/lib/utils/url_utility';
jest.mock('ee/api');
jest.mock('~/api');
jest.mock('~/lib/utils/url_utility');
const localVue = createLocalVue(Vue);
localVue.use(Vuex);
describe('ee/user_lists/components/edit_user_list', () => {
describe('user_lists/components/edit_user_list', () => {
let wrapper;
const setInputValue = value => wrapper.find('[data-testid="user-list-name"]').setValue(value);
......
......@@ -2,20 +2,20 @@ import { mount, createLocalVue } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import { GlAlert } from '@gitlab/ui';
import Api from 'ee/api';
import createStore from 'ee/user_lists/store/new';
import NewUserList from 'ee/user_lists/components/new_user_list.vue';
import waitForPromises from 'helpers/wait_for_promises';
import Api from '~/api';
import createStore from '~/user_lists/store/new';
import NewUserList from '~/user_lists/components/new_user_list.vue';
import { redirectTo } from '~/lib/utils/url_utility';
import { userList } from '../../feature_flags/mock_data';
jest.mock('ee/api');
jest.mock('~/api');
jest.mock('~/lib/utils/url_utility');
const localVue = createLocalVue(Vue);
localVue.use(Vuex);
describe('ee/user_lists/components/new_user_list', () => {
describe('user_lists/components/new_user_list', () => {
let wrapper;
const setInputValue = value => wrapper.find('[data-testid="user-list-name"]').setValue(value);
......
import { mount } from '@vue/test-utils';
import Form from 'ee/user_lists/components/user_list_form.vue';
import Form from '~/user_lists/components/user_list_form.vue';
import { userList } from '../../feature_flags/mock_data';
describe('ee/user_lists/components/user_list_form', () => {
describe('user_lists/components/user_list_form', () => {
let wrapper;
let input;
......
......@@ -3,13 +3,13 @@ import Vuex from 'vuex';
import { mount } from '@vue/test-utils';
import { uniq } from 'lodash';
import { GlAlert, GlEmptyState, GlLoadingIcon } from '@gitlab/ui';
import Api from 'ee/api';
import { parseUserIds, stringifyUserIds } from 'ee/user_lists/store/utils';
import createStore from 'ee/user_lists/store/show';
import UserList from 'ee/user_lists/components/user_list.vue';
import Api from '~/api';
import { parseUserIds, stringifyUserIds } from '~/user_lists/store/utils';
import createStore from '~/user_lists/store/show';
import UserList from '~/user_lists/components/user_list.vue';
import { userList } from '../../feature_flags/mock_data';
jest.mock('ee/api');
jest.mock('~/api');
Vue.use(Vuex);
......
import Api from 'ee/api';
import createState from 'ee/user_lists/store/edit/state';
import * as types from 'ee/user_lists/store/edit/mutation_types';
import * as actions from 'ee/user_lists/store/edit/actions';
import testAction from 'helpers/vuex_action_helper';
import Api from '~/api';
import createState from '~/user_lists/store/edit/state';
import * as types from '~/user_lists/store/edit/mutation_types';
import * as actions from '~/user_lists/store/edit/actions';
import { redirectTo } from '~/lib/utils/url_utility';
import { userList } from '../../../feature_flags/mock_data';
jest.mock('ee/api');
jest.mock('~/api');
jest.mock('~/lib/utils/url_utility');
describe('User Lists Edit Actions', () => {
......
import statuses from 'ee/user_lists/constants/edit';
import createState from 'ee/user_lists/store/edit/state';
import * as types from 'ee/user_lists/store/edit/mutation_types';
import mutations from 'ee/user_lists/store/edit/mutations';
import statuses from '~/user_lists/constants/edit';
import createState from '~/user_lists/store/edit/state';
import * as types from '~/user_lists/store/edit/mutation_types';
import mutations from '~/user_lists/store/edit/mutations';
import { userList } from '../../../feature_flags/mock_data';
describe('User List Edit Mutations', () => {
......
import Api from 'ee/api';
import createState from 'ee/user_lists/store/new/state';
import * as types from 'ee/user_lists/store/new/mutation_types';
import * as actions from 'ee/user_lists/store/new/actions';
import testAction from 'helpers/vuex_action_helper';
import Api from '~/api';
import createState from '~/user_lists/store/new/state';
import * as types from '~/user_lists/store/new/mutation_types';
import * as actions from '~/user_lists/store/new/actions';
import { redirectTo } from '~/lib/utils/url_utility';
import { userList } from '../../../feature_flags/mock_data';
jest.mock('ee/api');
jest.mock('~/api');
jest.mock('~/lib/utils/url_utility');
describe('User Lists Edit Actions', () => {
......
import createState from 'ee/user_lists/store/new/state';
import * as types from 'ee/user_lists/store/new/mutation_types';
import mutations from 'ee/user_lists/store/new/mutations';
import createState from '~/user_lists/store/new/state';
import * as types from '~/user_lists/store/new/mutation_types';
import mutations from '~/user_lists/store/new/mutations';
describe('User List Edit Mutations', () => {
let state;
......
import testAction from 'helpers/vuex_action_helper';
import Api from 'ee/api';
import { stringifyUserIds } from 'ee/user_lists/store/utils';
import createState from 'ee/user_lists/store/show/state';
import * as types from 'ee/user_lists/store/show/mutation_types';
import * as actions from 'ee/user_lists/store/show/actions';
import { userList } from 'ee_jest/feature_flags/mock_data';
import { userList } from 'jest/feature_flags/mock_data';
import Api from '~/api';
import { stringifyUserIds } from '~/user_lists/store/utils';
import createState from '~/user_lists/store/show/state';
import * as types from '~/user_lists/store/show/mutation_types';
import * as actions from '~/user_lists/store/show/actions';
jest.mock('ee/api');
jest.mock('~/api');
describe('User Lists Show Actions', () => {
let mockState;
......
import { uniq } from 'lodash';
import createState from 'ee/user_lists/store/show/state';
import mutations from 'ee/user_lists/store/show/mutations';
import { states } from 'ee/user_lists/constants/show';
import * as types from 'ee/user_lists/store/show/mutation_types';
import { userList } from 'ee_jest/feature_flags/mock_data';
import { userList } from 'jest/feature_flags/mock_data';
import createState from '~/user_lists/store/show/state';
import mutations from '~/user_lists/store/show/mutations';
import { states } from '~/user_lists/constants/show';
import * as types from '~/user_lists/store/show/mutation_types';
describe('User Lists Show Mutations', () => {
let mockState;
......
import { parseUserIds, stringifyUserIds } from 'ee/user_lists/store/utils';
import { parseUserIds, stringifyUserIds } from '~/user_lists/store/utils';
describe('User List Store Utils', () => {
describe('parseUserIds', () => {
......
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