summaryrefslogtreecommitdiff
path: root/spec/frontend/labels/components/promote_label_modal_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/labels/components/promote_label_modal_spec.js')
-rw-r--r--spec/frontend/labels/components/promote_label_modal_spec.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/frontend/labels/components/promote_label_modal_spec.js b/spec/frontend/labels/components/promote_label_modal_spec.js
index 8953e3cbcd8..97913c20229 100644
--- a/spec/frontend/labels/components/promote_label_modal_spec.js
+++ b/spec/frontend/labels/components/promote_label_modal_spec.js
@@ -6,6 +6,7 @@ import { TEST_HOST } from 'helpers/test_constants';
import { stubComponent } from 'helpers/stub_component';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_INTERNAL_SERVER_ERROR, HTTP_STATUS_OK } from '~/lib/utils/http_status';
import PromoteLabelModal from '~/labels/components/promote_label_modal.vue';
import eventHub from '~/labels/event_hub';
@@ -66,7 +67,7 @@ describe('Promote label modal', () => {
it('redirects when a label is promoted', async () => {
const responseURL = `${TEST_HOST}/dummy/endpoint`;
- axiosMock.onPost(labelMockData.url).reply(200, { url: responseURL });
+ axiosMock.onPost(labelMockData.url).reply(HTTP_STATUS_OK, { url: responseURL });
wrapper.findComponent(GlModal).vm.$emit('primary');
@@ -85,8 +86,10 @@ describe('Promote label modal', () => {
it('displays an error if promoting a label failed', async () => {
const dummyError = new Error('promoting label failed');
- dummyError.response = { status: 500 };
- axiosMock.onPost(labelMockData.url).reply(500, { error: dummyError });
+ dummyError.response = { status: HTTP_STATUS_INTERNAL_SERVER_ERROR };
+ axiosMock
+ .onPost(labelMockData.url)
+ .reply(HTTP_STATUS_INTERNAL_SERVER_ERROR, { error: dummyError });
wrapper.findComponent(GlModal).vm.$emit('primary');