Commit 9c119867 authored by Andrew Fontaine's avatar Andrew Fontaine

Port feature Flag New Actions Spec to Jest

Had to mock the `url_utility` module.
parent 4d7cb1c5
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import actions, { import {
setEndpoint, setEndpoint,
setPath, setPath,
createFeatureFlag, createFeatureFlag,
...@@ -10,7 +10,7 @@ import actions, { ...@@ -10,7 +10,7 @@ import actions, {
} from 'ee/feature_flags/store/modules/new/actions'; } from 'ee/feature_flags/store/modules/new/actions';
import state from 'ee/feature_flags/store/modules/new/state'; import state from 'ee/feature_flags/store/modules/new/state';
import * as types from 'ee/feature_flags/store/modules/new/mutation_types'; import * as types from 'ee/feature_flags/store/modules/new/mutation_types';
import testAction from 'spec/helpers/vuex_action_helper'; import testAction from 'helpers/vuex_action_helper';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
import { import {
ROLLOUT_STRATEGY_ALL_USERS, ROLLOUT_STRATEGY_ALL_USERS,
...@@ -18,6 +18,8 @@ import { ...@@ -18,6 +18,8 @@ import {
} from 'ee/feature_flags/constants'; } from 'ee/feature_flags/constants';
import { mapFromScopesViewModel } from 'ee/feature_flags/store/modules/helpers'; import { mapFromScopesViewModel } from 'ee/feature_flags/store/modules/helpers';
jest.mock('~/lib/utils/url_utility');
describe('Feature flags New Module Actions', () => { describe('Feature flags New Module Actions', () => {
let mockedState; let mockedState;
...@@ -74,7 +76,6 @@ describe('Feature flags New Module Actions', () => { ...@@ -74,7 +76,6 @@ describe('Feature flags New Module Actions', () => {
beforeEach(() => { beforeEach(() => {
mockedState.endpoint = `${TEST_HOST}/endpoint.json`; mockedState.endpoint = `${TEST_HOST}/endpoint.json`;
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
spyOnDependency(actions, 'visitUrl');
}); });
afterEach(() => { afterEach(() => {
......
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