diff options
Diffstat (limited to 'spec/frontend/sidebar/components/labels/labels_select_vue/store/actions_spec.js')
-rw-r--r-- | spec/frontend/sidebar/components/labels/labels_select_vue/store/actions_spec.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/frontend/sidebar/components/labels/labels_select_vue/store/actions_spec.js b/spec/frontend/sidebar/components/labels/labels_select_vue/store/actions_spec.js index 0e0024aa6c2..55651bccaa8 100644 --- a/spec/frontend/sidebar/components/labels/labels_select_vue/store/actions_spec.js +++ b/spec/frontend/sidebar/components/labels/labels_select_vue/store/actions_spec.js @@ -3,6 +3,7 @@ import MockAdapter from 'axios-mock-adapter'; import testAction from 'helpers/vuex_action_helper'; import { createAlert } from '~/flash'; import axios from '~/lib/utils/axios_utils'; +import { HTTP_STATUS_INTERNAL_SERVER_ERROR, HTTP_STATUS_OK } from '~/lib/utils/http_status'; import * as actions from '~/sidebar/components/labels/labels_select_vue/store/actions'; import * as types from '~/sidebar/components/labels/labels_select_vue/store/mutation_types'; import defaultState from '~/sidebar/components/labels/labels_select_vue/store/state'; @@ -121,7 +122,7 @@ describe('LabelsSelect Actions', () => { describe('on success', () => { it('dispatches `requestLabels` & `receiveLabelsSuccess` actions', () => { const labels = [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }]; - mock.onGet(/labels.json/).replyOnce(200, labels); + mock.onGet(/labels.json/).replyOnce(HTTP_STATUS_OK, labels); return testAction( actions.fetchLabels, @@ -135,7 +136,7 @@ describe('LabelsSelect Actions', () => { describe('on failure', () => { it('dispatches `requestLabels` & `receiveLabelsFailure` actions', () => { - mock.onGet(/labels.json/).replyOnce(500, {}); + mock.onGet(/labels.json/).replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR, {}); return testAction( actions.fetchLabels, @@ -205,7 +206,7 @@ describe('LabelsSelect Actions', () => { describe('on success', () => { it('dispatches `requestCreateLabel`, `fetchLabels` & `receiveCreateLabelSuccess` & `toggleDropdownContentsCreateView` actions', () => { const label = { id: 1 }; - mock.onPost(/labels.json/).replyOnce(200, label); + mock.onPost(/labels.json/).replyOnce(HTTP_STATUS_OK, label); return testAction( actions.createLabel, @@ -224,7 +225,7 @@ describe('LabelsSelect Actions', () => { describe('on failure', () => { it('dispatches `requestCreateLabel` & `receiveCreateLabelFailure` actions', () => { - mock.onPost(/labels.json/).replyOnce(500, {}); + mock.onPost(/labels.json/).replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR, {}); return testAction( actions.createLabel, |