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-01-30 09:08:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-30 09:08:49 +0300
commit6305f1dc00870f6e0635e2e850538a00bbd00bda (patch)
tree8a518cae3805b8d7269bfacc8ae60aa441fadb22 /spec/javascripts
parent1d388ed855838a2d50588c131f9f23815f148344 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/notes/components/discussion_counter_spec.js11
-rw-r--r--spec/javascripts/notes/components/noteable_discussion_spec.js31
2 files changed, 7 insertions, 35 deletions
diff --git a/spec/javascripts/notes/components/discussion_counter_spec.js b/spec/javascripts/notes/components/discussion_counter_spec.js
index de1fd87517a..9c7aed43a3b 100644
--- a/spec/javascripts/notes/components/discussion_counter_spec.js
+++ b/spec/javascripts/notes/components/discussion_counter_spec.js
@@ -7,6 +7,7 @@ import { noteableDataMock, discussionMock, notesDataMock } from '../mock_data';
describe('DiscussionCounter component', () => {
let store;
let vm;
+ const notes = { currentDiscussionId: null };
beforeEach(() => {
window.mrTabs = {};
@@ -25,7 +26,7 @@ describe('DiscussionCounter component', () => {
});
describe('methods', () => {
- describe('jumpToFirstUnresolvedDiscussion', () => {
+ describe('jumpToNextDiscussion', () => {
it('expands unresolved discussion', () => {
window.mrTabs.currentAction = 'show';
@@ -48,13 +49,14 @@ describe('DiscussionCounter component', () => {
store.replaceState({
...store.state,
discussions,
+ notes,
});
- vm.jumpToFirstUnresolvedDiscussion();
+ vm.jumpToNextDiscussion();
expect(vm.expandDiscussion).toHaveBeenCalledWith({ discussionId: firstDiscussionId });
});
- it('jumps to first unresolved discussion from diff tab if all diff discussions are resolved', () => {
+ it('jumps to next unresolved discussion from diff tab if all diff discussions are resolved', () => {
window.mrTabs.currentAction = 'diff';
spyOn(vm, 'switchToDiscussionsTabAndJumpTo').and.stub();
@@ -77,8 +79,9 @@ describe('DiscussionCounter component', () => {
store.replaceState({
...store.state,
discussions,
+ notes,
});
- vm.jumpToFirstUnresolvedDiscussion();
+ vm.jumpToNextDiscussion();
expect(vm.switchToDiscussionsTabAndJumpTo).toHaveBeenCalledWith(unresolvedId);
});
diff --git a/spec/javascripts/notes/components/noteable_discussion_spec.js b/spec/javascripts/notes/components/noteable_discussion_spec.js
index 6efc6485b9c..ee84fd2b091 100644
--- a/spec/javascripts/notes/components/noteable_discussion_spec.js
+++ b/spec/javascripts/notes/components/noteable_discussion_spec.js
@@ -101,37 +101,6 @@ describe('noteable_discussion component', () => {
});
});
- describe('methods', () => {
- describe('jumpToNextDiscussion', () => {
- it('expands next unresolved thread', done => {
- const discussion2 = getJSONFixture(discussionWithTwoUnresolvedNotes)[0];
- discussion2.resolved = false;
- discussion2.active = true;
- discussion2.id = 'next'; // prepare this for being identified as next one (to be jumped to)
- store.dispatch('setInitialNotes', [discussionMock, discussion2]);
- window.mrTabs.currentAction = 'show';
-
- wrapper.vm
- .$nextTick()
- .then(() => {
- spyOn(wrapper.vm, 'expandDiscussion').and.stub();
-
- const nextDiscussionId = discussion2.id;
-
- setFixtures(`<div class="discussion" data-discussion-id="${nextDiscussionId}"></div>`);
-
- wrapper.vm.jumpToNextDiscussion();
-
- expect(wrapper.vm.expandDiscussion).toHaveBeenCalledWith({
- discussionId: nextDiscussionId,
- });
- })
- .then(done)
- .catch(done.fail);
- });
- });
- });
-
describe('for resolved thread', () => {
beforeEach(() => {
const discussion = getJSONFixture(discussionWithTwoUnresolvedNotes)[0];