Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/notes/components/discussion_keyboard_navigator_spec.js')
-rw-r--r--spec/frontend/notes/components/discussion_keyboard_navigator_spec.js9
1 files changed, 7 insertions, 2 deletions
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);
});
});