summaryrefslogtreecommitdiff
path: root/spec/javascripts/boards
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2018-12-13 13:38:21 +0000
committerFatih Acet <acetfatih@gmail.com>2018-12-13 13:38:21 +0000
commit81ddb69255f36bccd79c714a2c12d542cf782f8d (patch)
tree323988a67f6263216be603eb2e1e661fd85fd9c0 /spec/javascripts/boards
parent3b14a44c3f9554b8aafeb1153ff3cf9358abad72 (diff)
parentf57b1323ffd72607eb72ec670a27cbf572732d96 (diff)
downloadgitlab-ce-81ddb69255f36bccd79c714a2c12d542cf782f8d.tar.gz
Merge branch '51994-disable-merging-labels-in-dropdowns' into 'master'
Resolve "Fix labels dropdown with multiple same names" Closes #51994 See merge request gitlab-org/gitlab-ce!23265
Diffstat (limited to 'spec/javascripts/boards')
-rw-r--r--spec/javascripts/boards/boards_store_spec.js7
-rw-r--r--spec/javascripts/boards/issue_spec.js18
2 files changed, 22 insertions, 3 deletions
diff --git a/spec/javascripts/boards/boards_store_spec.js b/spec/javascripts/boards/boards_store_spec.js
index 54f1edfb1f9..22f192bc7f3 100644
--- a/spec/javascripts/boards/boards_store_spec.js
+++ b/spec/javascripts/boards/boards_store_spec.js
@@ -65,6 +65,13 @@ describe('Store', () => {
expect(list).toBeDefined();
});
+ it('finds list by label ID', () => {
+ boardsStore.addList(listObj);
+ const list = boardsStore.findListByLabelId(listObj.label.id);
+
+ expect(list.id).toBe(listObj.id);
+ });
+
it('gets issue when new list added', done => {
boardsStore.addList(listObj);
const list = boardsStore.findList('id', listObj.id);
diff --git a/spec/javascripts/boards/issue_spec.js b/spec/javascripts/boards/issue_spec.js
index 437ab4bb3df..54fb0e8228b 100644
--- a/spec/javascripts/boards/issue_spec.js
+++ b/spec/javascripts/boards/issue_spec.js
@@ -55,15 +55,27 @@ describe('Issue model', () => {
expect(issue.labels.length).toBe(2);
});
- it('does not add existing label', () => {
+ it('does not add label if label id exists', () => {
+ issue.addLabel({
+ id: 1,
+ title: 'test 2',
+ color: 'blue',
+ description: 'testing',
+ });
+
+ expect(issue.labels.length).toBe(1);
+ expect(issue.labels[0].color).toBe('red');
+ });
+
+ it('adds other label with same title', () => {
issue.addLabel({
id: 2,
title: 'test',
color: 'blue',
- description: 'bugs!',
+ description: 'other test',
});
- expect(issue.labels.length).toBe(1);
+ expect(issue.labels.length).toBe(2);
});
it('finds label', () => {