diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/frontend/notes/deprecated_notes_spec.js | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/frontend/notes/deprecated_notes_spec.js')
-rw-r--r-- | spec/frontend/notes/deprecated_notes_spec.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/frontend/notes/deprecated_notes_spec.js b/spec/frontend/notes/deprecated_notes_spec.js index 7193475c96a..40b124b9029 100644 --- a/spec/frontend/notes/deprecated_notes_spec.js +++ b/spec/frontend/notes/deprecated_notes_spec.js @@ -3,6 +3,7 @@ import MockAdapter from 'axios-mock-adapter'; import $ from 'jquery'; import '~/behaviors/markdown/render_gfm'; +import { loadHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { createSpyObj } from 'helpers/jest_helpers'; import { TEST_HOST } from 'helpers/test_constants'; import waitForPromises from 'helpers/wait_for_promises'; @@ -33,7 +34,7 @@ gl.utils.disableButtonIfEmptyField = () => {}; // eslint-disable-next-line jest/no-disabled-tests describe.skip('Old Notes (~/deprecated_notes.js)', () => { beforeEach(() => { - loadFixtures(fixture); + loadHTMLFixture(fixture); // Re-declare this here so that test_setup.js#beforeEach() doesn't // overwrite it. @@ -50,12 +51,14 @@ describe.skip('Old Notes (~/deprecated_notes.js)', () => { setTestTimeoutOnce(4000); }); - afterEach(() => { + afterEach(async () => { // The Notes component sets a polling interval. Clear it after every run. // Make sure to use jest.runOnlyPendingTimers() instead of runAllTimers(). jest.clearAllTimers(); - return axios.waitForAll().finally(() => mockAxios.restore()); + await axios.waitForAll().finally(() => mockAxios.restore()); + + resetHTMLFixture(); }); it('loads the Notes class into the DOM', () => { @@ -629,7 +632,7 @@ describe.skip('Old Notes (~/deprecated_notes.js)', () => { let $notesContainer; beforeEach(() => { - loadFixtures('commit/show.html'); + loadHTMLFixture('commit/show.html'); mockAxios.onPost(NOTES_POST_PATH).reply(200, note); new Notes('', []); |