diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 18:06:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 18:06:00 +0000 |
commit | ea4762d464bb36f3e36e318db47086e41f493377 (patch) | |
tree | c2fb2b7d2eb2b775d9ab149dc3781975fcc4b7d5 /spec/frontend/notes | |
parent | 68b6846fa6c7b630cc8dab7a8474dcc34e4d67d4 (diff) | |
download | gitlab-ce-ea4762d464bb36f3e36e318db47086e41f493377.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes')
5 files changed, 12 insertions, 2 deletions
diff --git a/spec/frontend/notes/components/comment_form_spec.js b/spec/frontend/notes/components/comment_form_spec.js index 45b99b71e06..475ea4f0f7d 100644 --- a/spec/frontend/notes/components/comment_form_spec.js +++ b/spec/frontend/notes/components/comment_form_spec.js @@ -38,6 +38,7 @@ describe('issue_comment_form component', () => { }, store, sync: false, + attachToDocument: true, }); }; diff --git a/spec/frontend/notes/components/discussion_actions_spec.js b/spec/frontend/notes/components/discussion_actions_spec.js index 91f9dab2530..3ccfea121b0 100644 --- a/spec/frontend/notes/components/discussion_actions_spec.js +++ b/spec/frontend/notes/components/discussion_actions_spec.js @@ -37,6 +37,8 @@ describe('DiscussionActions', () => { shouldShowJumpToNextDiscussion: true, ...props, }, + sync: false, + attachToDocument: true, }); }; diff --git a/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js b/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js index fd439ba46bd..ed173eacfab 100644 --- a/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js +++ b/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js @@ -7,6 +7,7 @@ describe('JumpToNextDiscussionButton', () => { beforeEach(() => { wrapper = shallowMount(JumpToNextDiscussionButton, { sync: false, + attachToDocument: true, }); }); diff --git a/spec/frontend/notes/components/discussion_keyboard_navigator_spec.js b/spec/frontend/notes/components/discussion_keyboard_navigator_spec.js index 8881bedf3cc..b38cfa8fb4a 100644 --- a/spec/frontend/notes/components/discussion_keyboard_navigator_spec.js +++ b/spec/frontend/notes/components/discussion_keyboard_navigator_spec.js @@ -37,6 +37,7 @@ describe('notes/components/discussion_keyboard_navigator', () => { isDiff ? NEXT_DIFF_ID : NEXT_ID; notes.getters.previousUnresolvedDiscussionId = () => (currId, isDiff) => isDiff ? PREV_DIFF_ID : PREV_ID; + notes.getters.getDiscussion = () => id => ({ id }); storeOptions = { modules: { @@ -63,14 +64,18 @@ describe('notes/components/discussion_keyboard_navigator', () => { it('calls jumpToNextDiscussion when pressing `n`', () => { Mousetrap.trigger('n'); - expect(wrapper.vm.jumpToDiscussion).toHaveBeenCalledWith(expectedNextId); + expect(wrapper.vm.jumpToDiscussion).toHaveBeenCalledWith( + expect.objectContaining({ id: expectedNextId }), + ); expect(wrapper.vm.currentDiscussionId).toEqual(expectedNextId); }); it('calls jumpToPreviousDiscussion when pressing `p`', () => { Mousetrap.trigger('p'); - expect(wrapper.vm.jumpToDiscussion).toHaveBeenCalledWith(expectedPrevId); + expect(wrapper.vm.jumpToDiscussion).toHaveBeenCalledWith( + expect.objectContaining({ id: expectedPrevId }), + ); expect(wrapper.vm.currentDiscussionId).toEqual(expectedPrevId); }); }); diff --git a/spec/frontend/notes/components/discussion_notes_spec.js b/spec/frontend/notes/components/discussion_notes_spec.js index f77236b14bc..5ab26d742ca 100644 --- a/spec/frontend/notes/components/discussion_notes_spec.js +++ b/spec/frontend/notes/components/discussion_notes_spec.js @@ -36,6 +36,7 @@ describe('DiscussionNotes', () => { 'avatar-badge': '<span class="avatar-badge-slot-content" />', }, sync: false, + attachToDocument: true, }); }; |