diff options
Diffstat (limited to 'spec/frontend/monitoring/store')
-rw-r--r-- | spec/frontend/monitoring/store/actions_spec.js | 10 | ||||
-rw-r--r-- | spec/frontend/monitoring/store/mutations_spec.js | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/spec/frontend/monitoring/store/actions_spec.js b/spec/frontend/monitoring/store/actions_spec.js index 93af6526c67..fbe030b1a7d 100644 --- a/spec/frontend/monitoring/store/actions_spec.js +++ b/spec/frontend/monitoring/store/actions_spec.js @@ -4,8 +4,10 @@ import testAction from 'helpers/vuex_action_helper'; import { createAlert } from '~/flash'; import axios from '~/lib/utils/axios_utils'; import * as commonUtils from '~/lib/utils/common_utils'; -import statusCodes, { +import { + HTTP_STATUS_BAD_REQUEST, HTTP_STATUS_CREATED, + HTTP_STATUS_OK, HTTP_STATUS_UNPROCESSABLE_ENTITY, } from '~/lib/utils/http_status'; import { ENVIRONMENT_AVAILABLE_STATE } from '~/monitoring/constants'; @@ -983,7 +985,7 @@ describe('Monitoring store actions', () => { }); it('Failed POST request throws an error', async () => { - mock.onPost(state.dashboardsEndpoint).reply(statusCodes.BAD_REQUEST); + mock.onPost(state.dashboardsEndpoint).reply(HTTP_STATUS_BAD_REQUEST); await expect(testAction(duplicateSystemDashboard, {}, state, [], [])).rejects.toEqual( 'There was an error creating the dashboard.', @@ -994,7 +996,7 @@ describe('Monitoring store actions', () => { it('Failed POST request throws an error with a description', async () => { const backendErrorMsg = 'This file already exists!'; - mock.onPost(state.dashboardsEndpoint).reply(statusCodes.BAD_REQUEST, { + mock.onPost(state.dashboardsEndpoint).reply(HTTP_STATUS_BAD_REQUEST, { error: backendErrorMsg, }); @@ -1116,7 +1118,7 @@ describe('Monitoring store actions', () => { mock .onPost(panelPreviewEndpoint, { panel_yaml: mockYmlContent }) - .reply(statusCodes.OK, mockPanel); + .reply(HTTP_STATUS_OK, mockPanel); testAction( fetchPanelPreview, diff --git a/spec/frontend/monitoring/store/mutations_spec.js b/spec/frontend/monitoring/store/mutations_spec.js index 49e8ab9ebd4..3baef743f42 100644 --- a/spec/frontend/monitoring/store/mutations_spec.js +++ b/spec/frontend/monitoring/store/mutations_spec.js @@ -1,5 +1,4 @@ -import httpStatusCodes from '~/lib/utils/http_status'; - +import { HTTP_STATUS_BAD_REQUEST, HTTP_STATUS_SERVICE_UNAVAILABLE } from '~/lib/utils/http_status'; import { dashboardEmptyStates, metricStates } from '~/monitoring/constants'; import * as types from '~/monitoring/stores/mutation_types'; import mutations from '~/monitoring/stores/mutations'; @@ -318,7 +317,7 @@ describe('Monitoring mutations', () => { metricId, error: { response: { - status: httpStatusCodes.SERVICE_UNAVAILABLE, + status: HTTP_STATUS_SERVICE_UNAVAILABLE, }, }, }); @@ -336,7 +335,7 @@ describe('Monitoring mutations', () => { metricId, error: { response: { - status: httpStatusCodes.BAD_REQUEST, + status: HTTP_STATUS_BAD_REQUEST, }, }, }); |