diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /spec/frontend/captcha/captcha_modal_axios_interceptor_spec.js | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'spec/frontend/captcha/captcha_modal_axios_interceptor_spec.js')
-rw-r--r-- | spec/frontend/captcha/captcha_modal_axios_interceptor_spec.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/frontend/captcha/captcha_modal_axios_interceptor_spec.js b/spec/frontend/captcha/captcha_modal_axios_interceptor_spec.js index 553ca52f9ce..b2a25bc93ea 100644 --- a/spec/frontend/captcha/captcha_modal_axios_interceptor_spec.js +++ b/spec/frontend/captcha/captcha_modal_axios_interceptor_spec.js @@ -4,7 +4,10 @@ import { registerCaptchaModalInterceptor } from '~/captcha/captcha_modal_axios_i import UnsolvedCaptchaError from '~/captcha/unsolved_captcha_error'; import { waitForCaptchaToBeSolved } from '~/captcha/wait_for_captcha_to_be_solved'; import axios from '~/lib/utils/axios_utils'; -import httpStatusCodes from '~/lib/utils/http_status'; +import httpStatusCodes, { + HTTP_STATUS_CONFLICT, + HTTP_STATUS_METHOD_NOT_ALLOWED, +} from '~/lib/utils/http_status'; jest.mock('~/captcha/wait_for_captcha_to_be_solved'); @@ -33,7 +36,7 @@ describe('registerCaptchaModalInterceptor', () => { mock.onAny('/endpoint-with-unrelated-error').reply(404, AXIOS_RESPONSE); mock.onAny('/endpoint-with-captcha').reply((config) => { if (!supportedMethods.includes(config.method)) { - return [httpStatusCodes.METHOD_NOT_ALLOWED, { method: config.method }]; + return [HTTP_STATUS_METHOD_NOT_ALLOWED, { method: config.method }]; } const data = JSON.parse(config.data); @@ -46,7 +49,7 @@ describe('registerCaptchaModalInterceptor', () => { return [httpStatusCodes.OK, { ...data, method: config.method, CAPTCHA_SUCCESS }]; } - return [httpStatusCodes.CONFLICT, NEEDS_CAPTCHA_RESPONSE]; + return [HTTP_STATUS_CONFLICT, NEEDS_CAPTCHA_RESPONSE]; }); axios.interceptors.response.handlers = []; @@ -123,7 +126,7 @@ describe('registerCaptchaModalInterceptor', () => { await expect(() => axios[method]('/endpoint-with-captcha')).rejects.toThrow( expect.objectContaining({ response: expect.objectContaining({ - status: httpStatusCodes.METHOD_NOT_ALLOWED, + status: HTTP_STATUS_METHOD_NOT_ALLOWED, data: { method }, }), }), |