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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-23 21:10:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-23 21:10:06 +0300
commit7ab026e2a20cd76e86929a4102a809542055897f (patch)
tree7b2e662fc3fb96033c82cf0d77f30e4adc14f3eb /spec/frontend/notes/mixins
parent14fb5a922285d71fea67de59164ee4bb81ee3486 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes/mixins')
-rw-r--r--spec/frontend/notes/mixins/discussion_navigation_spec.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/frontend/notes/mixins/discussion_navigation_spec.js b/spec/frontend/notes/mixins/discussion_navigation_spec.js
index ecff95b6fe0..32c6cfb110e 100644
--- a/spec/frontend/notes/mixins/discussion_navigation_spec.js
+++ b/spec/frontend/notes/mixins/discussion_navigation_spec.js
@@ -66,6 +66,35 @@ describe('Discussion navigation mixin', () => {
const findDiscussion = (selector, id) =>
document.querySelector(`${selector}[data-discussion-id="${id}"]`);
+ describe('jumpToFirstUnresolvedDiscussion method', () => {
+ let vm;
+
+ beforeEach(() => {
+ createComponent();
+
+ ({ vm } = wrapper);
+
+ jest.spyOn(store, 'dispatch');
+ jest.spyOn(vm, 'jumpToNextDiscussion');
+ });
+
+ it('triggers the setCurrentDiscussionId action with null as the value', () => {
+ vm.jumpToFirstUnresolvedDiscussion();
+
+ expect(store.dispatch).toHaveBeenCalledWith('setCurrentDiscussionId', null);
+ });
+
+ it('triggers the jumpToNextDiscussion action when the previous store action succeeds', () => {
+ store.dispatch.mockResolvedValue();
+
+ vm.jumpToFirstUnresolvedDiscussion();
+
+ return vm.$nextTick().then(() => {
+ expect(vm.jumpToNextDiscussion).toHaveBeenCalled();
+ });
+ });
+ });
+
describe('cycle through discussions', () => {
beforeEach(() => {
window.mrTabs = { eventHub: createEventHub(), tabShown: jest.fn() };