diff options
Diffstat (limited to 'spec/frontend/feature_flags/store/edit/actions_spec.js')
-rw-r--r-- | spec/frontend/feature_flags/store/edit/actions_spec.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/spec/frontend/feature_flags/store/edit/actions_spec.js b/spec/frontend/feature_flags/store/edit/actions_spec.js index 7132e83a940..8b9b42f4eb1 100644 --- a/spec/frontend/feature_flags/store/edit/actions_spec.js +++ b/spec/frontend/feature_flags/store/edit/actions_spec.js @@ -17,6 +17,7 @@ import * as types from '~/feature_flags/store/edit/mutation_types'; import state from '~/feature_flags/store/edit/state'; import { mapStrategiesToRails } from '~/feature_flags/store/helpers'; import axios from '~/lib/utils/axios_utils'; +import { HTTP_STATUS_INTERNAL_SERVER_ERROR, HTTP_STATUS_OK } from '~/lib/utils/http_status'; jest.mock('~/lib/utils/url_utility'); @@ -55,7 +56,9 @@ describe('Feature flags Edit Module actions', () => { }, ], }; - mock.onPut(mockedState.endpoint, mapStrategiesToRails(featureFlag)).replyOnce(200); + mock + .onPut(mockedState.endpoint, mapStrategiesToRails(featureFlag)) + .replyOnce(HTTP_STATUS_OK); return testAction( updateFeatureFlag, @@ -76,7 +79,9 @@ describe('Feature flags Edit Module actions', () => { describe('error', () => { it('dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagError', () => { - mock.onPut(`${TEST_HOST}/endpoint.json`).replyOnce(500, { message: [] }); + mock + .onPut(`${TEST_HOST}/endpoint.json`) + .replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR, { message: [] }); return testAction( updateFeatureFlag, @@ -155,7 +160,7 @@ describe('Feature flags Edit Module actions', () => { describe('success', () => { it('dispatches requestFeatureFlag and receiveFeatureFlagSuccess', () => { - mock.onGet(`${TEST_HOST}/endpoint.json`).replyOnce(200, { id: 1 }); + mock.onGet(`${TEST_HOST}/endpoint.json`).replyOnce(HTTP_STATUS_OK, { id: 1 }); return testAction( fetchFeatureFlag, @@ -177,7 +182,9 @@ describe('Feature flags Edit Module actions', () => { describe('error', () => { it('dispatches requestFeatureFlag and receiveUpdateFeatureFlagError', () => { - mock.onGet(`${TEST_HOST}/endpoint.json`, {}).replyOnce(500, {}); + mock + .onGet(`${TEST_HOST}/endpoint.json`, {}) + .replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR, {}); return testAction( fetchFeatureFlag, |