diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/frontend/diffs/components/diff_line_note_form_spec.js | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/frontend/diffs/components/diff_line_note_form_spec.js')
-rw-r--r-- | spec/frontend/diffs/components/diff_line_note_form_spec.js | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/spec/frontend/diffs/components/diff_line_note_form_spec.js b/spec/frontend/diffs/components/diff_line_note_form_spec.js index 0ccf996e220..fb9dc22ce25 100644 --- a/spec/frontend/diffs/components/diff_line_note_form_spec.js +++ b/spec/frontend/diffs/components/diff_line_note_form_spec.js @@ -4,7 +4,7 @@ import DiffLineNoteForm from '~/diffs/components/diff_line_note_form.vue'; import { createStore } from '~/mr_notes/stores'; import NoteForm from '~/notes/components/note_form.vue'; import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal'; -import { noteableDataMock } from '../../notes/mock_data'; +import { noteableDataMock } from 'jest/notes/mock_data'; import diffFileMockData from '../mock_data/diff_file'; jest.mock('~/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal', () => { @@ -98,7 +98,7 @@ describe('DiffLineNoteForm', () => { }); describe('saveNoteForm', () => { - it('should call saveNote action with proper params', (done) => { + it('should call saveNote action with proper params', async () => { const saveDiffDiscussionSpy = jest .spyOn(wrapper.vm, 'saveDiffDiscussion') .mockReturnValue(Promise.resolve()); @@ -123,16 +123,11 @@ describe('DiffLineNoteForm', () => { lineRange, }; - wrapper.vm - .handleSaveNote('note body') - .then(() => { - expect(saveDiffDiscussionSpy).toHaveBeenCalledWith({ - note: 'note body', - formData, - }); - }) - .then(done) - .catch(done.fail); + await wrapper.vm.handleSaveNote('note body'); + expect(saveDiffDiscussionSpy).toHaveBeenCalledWith({ + note: 'note body', + formData, + }); }); }); }); |