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