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
path: root/spec
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-01-27 19:49:56 +0300
committerFatih Acet <acetfatih@gmail.com>2017-02-03 17:02:44 +0300
commita943241056961c7b820adfd8fd08edd25c3a563a (patch)
tree4fd0a70fcbb31804748ee6fa7fb928850c206d12 /spec
parent8b977b295e887f7d134cd92ec352a24c0afd5950 (diff)
Some styling updates
Does not remove the issue from the selected tab when it it de-selected, it instead gets purged when changing tab
Diffstat (limited to 'spec')
-rw-r--r--spec/features/boards/add_issues_modal_spec.rb3
-rw-r--r--spec/javascripts/boards/modal_store_spec.js.es619
2 files changed, 21 insertions, 1 deletions
diff --git a/spec/features/boards/add_issues_modal_spec.rb b/spec/features/boards/add_issues_modal_spec.rb
index e6065c0740d..5ba044a4f3c 100644
--- a/spec/features/boards/add_issues_modal_spec.rb
+++ b/spec/features/boards/add_issues_modal_spec.rb
@@ -10,6 +10,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
let!(:planning) { create(:label, project: project, name: 'Planning') }
let!(:label) { create(:label, project: project) }
let!(:list1) { create(:list, board: board, label: planning, position: 0) }
+ let!(:list2) { create(:list, board: board, label: label, position: 1) }
let!(:issue) { create(:issue, project: project) }
let!(:issue2) { create(:issue, project: project) }
@@ -172,7 +173,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
first('.card').click
- expect(page).not_to have_selector('.card')
+ expect(page).not_to have_selector('.is-active')
end
end
end
diff --git a/spec/javascripts/boards/modal_store_spec.js.es6 b/spec/javascripts/boards/modal_store_spec.js.es6
index 9c0625357bd..3f44e427201 100644
--- a/spec/javascripts/boards/modal_store_spec.js.es6
+++ b/spec/javascripts/boards/modal_store_spec.js.es6
@@ -81,6 +81,7 @@ describe('Modal store', () => {
});
it('adds issue to selected array', () => {
+ issue.selected = true;
Store.addSelectedIssue(issue);
expect(Store.selectedCount()).toBe(1);
@@ -112,4 +113,22 @@ describe('Modal store', () => {
it('does not find a selected issue', () => {
expect(Store.findSelectedIssue(issue)).toBe(undefined);
});
+
+ it('does not remove from selected issue if tab is not all', () => {
+ Store.store.activeTab = 'selected';
+
+ Store.toggleIssue(issue);
+ Store.toggleIssue(issue);
+
+ expect(Store.store.selectedIssues.length).toBe(1);
+ expect(Store.selectedCount()).toBe(0);
+ });
+
+ it('gets selected issue array with only selected issues', () => {
+ Store.toggleIssue(issue);
+ Store.toggleIssue(issue2);
+ Store.toggleIssue(issue2);
+
+ expect(Store.getSelectedIssues().length).toBe(1);
+ });
});