summaryrefslogtreecommitdiff
path: root/spec/javascripts/notes
diff options
context:
space:
mode:
authorSamantha Ming <sming@gitlab.com>2019-06-28 07:32:03 +0000
committerPhil Hughes <me@iamphill.com>2019-06-28 07:32:03 +0000
commit4bf043435906db75fa9543db96991b8cc7171f46 (patch)
tree12d2e52d8de2ee0d174f225c0b64ea1c43c6beea /spec/javascripts/notes
parentae68c7ea142b12fe179a4027b17d31ac6fb2649c (diff)
downloadgitlab-ce-4bf043435906db75fa9543db96991b8cc7171f46.tar.gz
Rearrange discussion resolve buttons & update button display
- next-discuss button is always show unless there is only 1 discussion - regroup buttons arrangements
Diffstat (limited to 'spec/javascripts/notes')
-rw-r--r--spec/javascripts/notes/stores/getters_spec.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/javascripts/notes/stores/getters_spec.js b/spec/javascripts/notes/stores/getters_spec.js
index 8f3c493dd4c..c3ed079e33b 100644
--- a/spec/javascripts/notes/stores/getters_spec.js
+++ b/spec/javascripts/notes/stores/getters_spec.js
@@ -32,6 +32,26 @@ describe('Getters Notes Store', () => {
};
});
+ describe('showJumpToNextDiscussion', () => {
+ it('should return true if there are 2 or more unresolved discussions', () => {
+ const localGetters = {
+ unresolvedDiscussionsIdsByDate: ['123', '456'],
+ allResolvableDiscussions: [],
+ };
+
+ expect(getters.showJumpToNextDiscussion(state, localGetters)()).toBe(true);
+ });
+
+ it('should return false if there are 1 or less unresolved discussions', () => {
+ const localGetters = {
+ unresolvedDiscussionsIdsByDate: ['123'],
+ allResolvableDiscussions: [],
+ };
+
+ expect(getters.showJumpToNextDiscussion(state, localGetters)()).toBe(false);
+ });
+ });
+
describe('discussions', () => {
it('should return all discussions in the store', () => {
expect(getters.discussions(state)).toEqual([individualNote]);