diff options
Diffstat (limited to 'spec/frontend/vue_shared/security_reports/store/modules/sast/actions_spec.js')
-rw-r--r-- | spec/frontend/vue_shared/security_reports/store/modules/sast/actions_spec.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/spec/frontend/vue_shared/security_reports/store/modules/sast/actions_spec.js b/spec/frontend/vue_shared/security_reports/store/modules/sast/actions_spec.js index 46bfd7eceb1..0cab950cb77 100644 --- a/spec/frontend/vue_shared/security_reports/store/modules/sast/actions_spec.js +++ b/spec/frontend/vue_shared/security_reports/store/modules/sast/actions_spec.js @@ -2,6 +2,7 @@ import MockAdapter from 'axios-mock-adapter'; import testAction from 'helpers/vuex_action_helper'; import axios from '~/lib/utils/axios_utils'; +import { HTTP_STATUS_NOT_FOUND, HTTP_STATUS_OK } from '~/lib/utils/http_status'; import * as actions from '~/vue_shared/security_reports/store/modules/sast/actions'; import * as types from '~/vue_shared/security_reports/store/modules/sast/mutation_types'; import createState from '~/vue_shared/security_reports/store/modules/sast/state'; @@ -99,9 +100,9 @@ describe('sast report actions', () => { beforeEach(() => { mock .onGet(diffEndpoint) - .replyOnce(200, reports.diff) + .replyOnce(HTTP_STATUS_OK, reports.diff) .onGet(vulnerabilityFeedbackPath) - .replyOnce(200, reports.enrichData); + .replyOnce(HTTP_STATUS_OK, reports.enrichData); }); it('should dispatch the `receiveDiffSuccess` action', () => { @@ -128,7 +129,7 @@ describe('sast report actions', () => { describe('when diff endpoint responds successfully and fetching vulnerability feedback is not authorized', () => { beforeEach(() => { rootState.canReadVulnerabilityFeedback = false; - mock.onGet(diffEndpoint).replyOnce(200, reports.diff); + mock.onGet(diffEndpoint).replyOnce(HTTP_STATUS_OK, reports.diff); }); it('should dispatch the `receiveDiffSuccess` action with empty enrich data', () => { @@ -157,9 +158,9 @@ describe('sast report actions', () => { beforeEach(() => { mock .onGet(diffEndpoint) - .replyOnce(200, reports.diff) + .replyOnce(HTTP_STATUS_OK, reports.diff) .onGet(vulnerabilityFeedbackPath) - .replyOnce(404); + .replyOnce(HTTP_STATUS_NOT_FOUND); }); it('should dispatch the `receiveError` action', () => { @@ -177,9 +178,9 @@ describe('sast report actions', () => { beforeEach(() => { mock .onGet(diffEndpoint) - .replyOnce(404) + .replyOnce(HTTP_STATUS_NOT_FOUND) .onGet(vulnerabilityFeedbackPath) - .replyOnce(200, reports.enrichData); + .replyOnce(HTTP_STATUS_OK, reports.enrichData); }); it('should dispatch the `receiveDiffError` action', () => { |