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/admin/statistics_panel/store/actions_spec.js')
-rw-r--r--spec/frontend/admin/statistics_panel/store/actions_spec.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/frontend/admin/statistics_panel/store/actions_spec.js b/spec/frontend/admin/statistics_panel/store/actions_spec.js
index e7cdb5feb6a..20d5860a459 100644
--- a/spec/frontend/admin/statistics_panel/store/actions_spec.js
+++ b/spec/frontend/admin/statistics_panel/store/actions_spec.js
@@ -5,6 +5,7 @@ import * as actions from '~/admin/statistics_panel/store/actions';
import * as types from '~/admin/statistics_panel/store/mutation_types';
import getInitialState from '~/admin/statistics_panel/store/state';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
+import { HTTP_STATUS_INTERNAL_SERVER_ERROR, HTTP_STATUS_OK } from '~/lib/utils/http_status';
import mockStatistics from '../mock_data';
describe('Admin statistics panel actions', () => {
@@ -19,7 +20,7 @@ describe('Admin statistics panel actions', () => {
describe('fetchStatistics', () => {
describe('success', () => {
beforeEach(() => {
- mock.onGet(/api\/(.*)\/application\/statistics/).replyOnce(200, mockStatistics);
+ mock.onGet(/api\/(.*)\/application\/statistics/).replyOnce(HTTP_STATUS_OK, mockStatistics);
});
it('dispatches success with received data', () => {
@@ -43,7 +44,9 @@ describe('Admin statistics panel actions', () => {
describe('error', () => {
beforeEach(() => {
- mock.onGet(/api\/(.*)\/application\/statistics/).replyOnce(500);
+ mock
+ .onGet(/api\/(.*)\/application\/statistics/)
+ .replyOnce(HTTP_STATUS_INTERNAL_SERVER_ERROR);
});
it('dispatches error', () => {
@@ -99,12 +102,12 @@ describe('Admin statistics panel actions', () => {
it('should commit error', () => {
return testAction(
actions.receiveStatisticsError,
- 500,
+ HTTP_STATUS_INTERNAL_SERVER_ERROR,
state,
[
{
type: types.RECEIVE_STATISTICS_ERROR,
- payload: 500,
+ payload: HTTP_STATUS_INTERNAL_SERVER_ERROR,
},
],
[],