Commit f4511a45 authored by Andrew Fontaine's avatar Andrew Fontaine

Port Feature Flags Edit Actions Spec to Jest

Had to mock the `url_utility` functions.
parent e33a71f2
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,
updateFeatureFlag, updateFeatureFlag,
...@@ -15,9 +15,11 @@ import actions, { ...@@ -15,9 +15,11 @@ import actions, {
} from 'ee/feature_flags/store/modules/edit/actions'; } from 'ee/feature_flags/store/modules/edit/actions';
import state from 'ee/feature_flags/store/modules/edit/state'; import state from 'ee/feature_flags/store/modules/edit/state';
import * as types from 'ee/feature_flags/store/modules/edit/mutation_types'; import * as types from 'ee/feature_flags/store/modules/edit/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';
jest.mock('~/lib/utils/url_utility');
describe('Feature flags Edit Module actions', () => { describe('Feature flags Edit Module actions', () => {
let mockedState; let mockedState;
...@@ -57,7 +59,6 @@ describe('Feature flags Edit Module actions', () => { ...@@ -57,7 +59,6 @@ describe('Feature flags Edit 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