Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/clusters_list/store/actions_spec.js')
-rw-r--r--spec/frontend/clusters_list/store/actions_spec.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/frontend/clusters_list/store/actions_spec.js b/spec/frontend/clusters_list/store/actions_spec.js
index 1deebf8b75a..360fd3b2842 100644
--- a/spec/frontend/clusters_list/store/actions_spec.js
+++ b/spec/frontend/clusters_list/store/actions_spec.js
@@ -7,6 +7,7 @@ import * as actions from '~/clusters_list/store/actions';
import * as types from '~/clusters_list/store/mutation_types';
import { createAlert } from '~/flash';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_BAD_REQUEST, HTTP_STATUS_OK } from '~/lib/utils/http_status';
import Poll from '~/lib/utils/poll';
import { apiData } from '../mock_data';
@@ -65,7 +66,7 @@ describe('Clusters store actions', () => {
afterEach(() => mock.restore());
it('should commit SET_CLUSTERS_DATA with received response', () => {
- mock.onGet().reply(200, apiData, headers);
+ mock.onGet().reply(HTTP_STATUS_OK, apiData, headers);
return testAction(
actions.fetchClusters,
@@ -81,7 +82,7 @@ describe('Clusters store actions', () => {
});
it('should show flash on API error', async () => {
- mock.onGet().reply(400, 'Not Found');
+ mock.onGet().reply(HTTP_STATUS_BAD_REQUEST, 'Not Found');
await testAction(
actions.fetchClusters,
@@ -118,7 +119,7 @@ describe('Clusters store actions', () => {
pollRequest = jest.spyOn(Poll.prototype, 'makeRequest');
pollStop = jest.spyOn(Poll.prototype, 'stop');
- mock.onGet().reply(200, apiData, pollHeaders);
+ mock.onGet().reply(HTTP_STATUS_OK, apiData, pollHeaders);
});
afterEach(() => {
@@ -171,7 +172,7 @@ describe('Clusters store actions', () => {
it('should stop polling and report to Sentry when data is invalid', async () => {
const badApiResponse = { clusters: {} };
- mock.onGet().reply(200, badApiResponse, pollHeaders);
+ mock.onGet().reply(HTTP_STATUS_OK, badApiResponse, pollHeaders);
await testAction(
actions.fetchClusters,