diff options
Diffstat (limited to 'spec/frontend/lib/utils/axios_utils_spec.js')
-rw-r--r-- | spec/frontend/lib/utils/axios_utils_spec.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/frontend/lib/utils/axios_utils_spec.js b/spec/frontend/lib/utils/axios_utils_spec.js index 1585a38ae86..2656fb1d648 100644 --- a/spec/frontend/lib/utils/axios_utils_spec.js +++ b/spec/frontend/lib/utils/axios_utils_spec.js @@ -3,14 +3,15 @@ import AxiosMockAdapter from 'axios-mock-adapter'; import axios from '~/lib/utils/axios_utils'; +import { HTTP_STATUS_INTERNAL_SERVER_ERROR, HTTP_STATUS_OK } from '~/lib/utils/http_status'; describe('axios_utils', () => { let mock; beforeEach(() => { mock = new AxiosMockAdapter(axios); - mock.onAny('/ok').reply(200); - mock.onAny('/err').reply(500); + mock.onAny('/ok').reply(HTTP_STATUS_OK); + mock.onAny('/err').reply(HTTP_STATUS_INTERNAL_SERVER_ERROR); // eslint-disable-next-line jest/no-standalone-expect expect(axios.countActiveRequests()).toBe(0); }); @@ -27,8 +28,8 @@ describe('axios_utils', () => { return axios.waitForAll().finally(() => { expect(handler).toHaveBeenCalledTimes(2); - expect(handler.mock.calls[0][0].status).toBe(200); - expect(handler.mock.calls[1][0].response.status).toBe(500); + expect(handler.mock.calls[0][0].status).toBe(HTTP_STATUS_OK); + expect(handler.mock.calls[1][0].response.status).toBe(HTTP_STATUS_INTERNAL_SERVER_ERROR); }); }); }); |