diff options
Diffstat (limited to 'spec/frontend/single_file_diff_spec.js')
-rw-r--r-- | spec/frontend/single_file_diff_spec.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/frontend/single_file_diff_spec.js b/spec/frontend/single_file_diff_spec.js index 6f42ec47458..ff2a4e31e0b 100644 --- a/spec/frontend/single_file_diff_spec.js +++ b/spec/frontend/single_file_diff_spec.js @@ -2,6 +2,7 @@ import MockAdapter from 'axios-mock-adapter'; import $ from 'jquery'; import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import axios from '~/lib/utils/axios_utils'; +import { HTTP_STATUS_BAD_REQUEST, HTTP_STATUS_OK } from '~/lib/utils/http_status'; import SingleFileDiff from '~/single_file_diff'; describe('SingleFileDiff', () => { @@ -10,7 +11,9 @@ describe('SingleFileDiff', () => { beforeEach(() => { mock = new MockAdapter(axios); - mock.onGet(blobDiffPath).replyOnce(200, { html: `<div class="diff-content">MOCKED</div>` }); + mock + .onGet(blobDiffPath) + .replyOnce(HTTP_STATUS_OK, { html: `<div class="diff-content">MOCKED</div>` }); }); afterEach(() => { @@ -54,7 +57,7 @@ describe('SingleFileDiff', () => { expect(diff.isOpen).toBe(false); expect(diff.content).not.toBeNull(); - mock.onGet(blobDiffPath).replyOnce(400, ''); + mock.onGet(blobDiffPath).replyOnce(HTTP_STATUS_BAD_REQUEST, ''); // Opening again await diff.toggleDiff($(document.querySelector('.js-file-title'))); |