diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:53 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:53 +0000 |
commit | 110225407ff1476b102ae905ba2e9a01e5ab34a2 (patch) | |
tree | 0959369327271f807266606a882aaf479dc96e00 /spec/frontend | |
parent | b28d414aeffb5d1974747325a3be905dd42f2ad0 (diff) | |
download | gitlab-ce-110225407ff1476b102ae905ba2e9a01e5ab34a2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/notes/deprecated_notes_spec.js (renamed from spec/frontend/notes/old_notes_spec.js) | 7 | ||||
-rw-r--r-- | spec/frontend/zen_mode_spec.js | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/spec/frontend/notes/old_notes_spec.js b/spec/frontend/notes/deprecated_notes_spec.js index 0cf43b8fd97..34623f8aa13 100644 --- a/spec/frontend/notes/old_notes_spec.js +++ b/spec/frontend/notes/deprecated_notes_spec.js @@ -14,9 +14,8 @@ import * as urlUtility from '~/lib/utils/url_utility'; window.jQuery = $; require('autosize'); require('~/commons'); -require('~/notes'); +const Notes = require('~/deprecated_notes').default; -const { Notes } = window; const FLASH_TYPE_ALERT = 'alert'; const NOTES_POST_PATH = /(.*)\/notes\?html=true$/; const fixture = 'snippets/show.html'; @@ -31,7 +30,7 @@ gl.utils.disableButtonIfEmptyField = () => {}; // the following test is unreliable and failing in main 2-3 times a day // see https://gitlab.com/gitlab-org/gitlab/issues/206906#note_290602581 // eslint-disable-next-line jest/no-disabled-tests -describe.skip('Old Notes (~/notes.js)', () => { +describe.skip('Old Notes (~/deprecated_notes.js)', () => { beforeEach(() => { loadFixtures(fixture); @@ -67,7 +66,7 @@ describe.skip('Old Notes (~/notes.js)', () => { it('calls postComment when comment button is clicked', () => { jest.spyOn(Notes.prototype, 'postComment'); - new window.Notes('', []); + new Notes('', []); $('.js-comment-button').click(); expect(Notes.prototype.postComment).toHaveBeenCalled(); }); diff --git a/spec/frontend/zen_mode_spec.js b/spec/frontend/zen_mode_spec.js index bf4b57d8afb..13f221fd9d9 100644 --- a/spec/frontend/zen_mode_spec.js +++ b/spec/frontend/zen_mode_spec.js @@ -3,7 +3,7 @@ import MockAdapter from 'axios-mock-adapter'; import Dropzone from 'dropzone'; import $ from 'jquery'; import Mousetrap from 'mousetrap'; -import initNotes from '~/init_notes'; +import GLForm from '~/gl_form'; import * as utils from '~/lib/utils/common_utils'; import ZenMode from '~/zen_mode'; @@ -34,7 +34,9 @@ describe('ZenMode', () => { mock.onGet().reply(200); loadFixtures(fixtureName); - initNotes(); + + const form = $('.js-new-note-form'); + new GLForm(form); // eslint-disable-line no-new dropzoneForElementSpy = jest.spyOn(Dropzone, 'forElement').mockImplementation(() => ({ enable: () => true, |