summaryrefslogtreecommitdiff
path: root/spec/features/dashboard
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-03-27 17:29:13 +0200
committerWinnie Hellmann <winnie@gitlab.com>2018-04-03 20:19:20 +0200
commitd10416e231a27c63c322ba7338f2ea8279436336 (patch)
tree96283755995507d3149b0077bbe06ec812f855e0 /spec/features/dashboard
parenta32941aee32ddfd7b114011f951741e06a53be5d (diff)
downloadgitlab-ce-d10416e231a27c63c322ba7338f2ea8279436336.tar.gz
Fixed dashboard filtering tests
Diffstat (limited to 'spec/features/dashboard')
-rw-r--r--spec/features/dashboard/issues_filter_spec.rb32
-rw-r--r--spec/features/dashboard/merge_requests_spec.rb8
2 files changed, 18 insertions, 22 deletions
diff --git a/spec/features/dashboard/issues_filter_spec.rb b/spec/features/dashboard/issues_filter_spec.rb
index 029fc45c791..b15f3afca4a 100644
--- a/spec/features/dashboard/issues_filter_spec.rb
+++ b/spec/features/dashboard/issues_filter_spec.rb
@@ -17,6 +17,12 @@ feature 'Dashboard Issues filtering', :js do
visit_issues
end
+ context 'without any filter' do
+ it 'shows error message' do
+ expect(page).to have_content 'Please select at least one filter to see results'
+ end
+ end
+
context 'filtering by milestone' do
it 'shows all issues with no milestone' do
show_milestone_dropdown
@@ -27,15 +33,6 @@ feature 'Dashboard Issues filtering', :js do
expect(page).to have_selector('.issue', count: 1)
end
- it 'shows all issues with any milestone' do
- show_milestone_dropdown
-
- click_link 'Any Milestone'
-
- expect(page).to have_issuable_counts(open: 2, closed: 0, all: 2)
- expect(page).to have_selector('.issue', count: 2)
- end
-
it 'shows all issues with the selected milestone' do
show_milestone_dropdown
@@ -68,13 +65,6 @@ feature 'Dashboard Issues filtering', :js do
let(:label) { create(:label, project: project) }
let!(:label_link) { create(:label_link, label: label, target: issue) }
- it 'shows all issues without filter' do
- page.within 'ul.content-list' do
- expect(page).to have_content issue.title
- expect(page).to have_content issue2.title
- end
- end
-
it 'shows all issues with the selected label' do
page.within '.labels-filter' do
find('.dropdown').click
@@ -89,9 +79,19 @@ feature 'Dashboard Issues filtering', :js do
end
context 'sorting' do
+<<<<<<< HEAD
it 'shows sorted issues' do
sort_by('Created date')
visit_issues
+=======
+ before do
+ visit_issues(assignee_id: user.id)
+ end
+
+ it 'remembers last sorting value' do
+ sorting_by('Created date')
+ visit_issues(assignee_id: user.id)
+>>>>>>> Fixed dashboard filtering tests
expect(find('.issues-filters')).to have_content('Created date')
end
diff --git a/spec/features/dashboard/merge_requests_spec.rb b/spec/features/dashboard/merge_requests_spec.rb
index 4a9344115d2..0965b745c03 100644
--- a/spec/features/dashboard/merge_requests_spec.rb
+++ b/spec/features/dashboard/merge_requests_spec.rb
@@ -103,15 +103,11 @@ feature 'Dashboard Merge Requests' do
expect(page).not_to have_content(other_merge_request.title)
end
- it 'shows all merge requests', :js do
+ it 'shows error message without filter', :js do
filter_item_select('Any Assignee', '.js-assignee-search')
filter_item_select('Any Author', '.js-author-search')
- expect(page).to have_content(authored_merge_request.title)
- expect(page).to have_content(authored_merge_request_from_fork.title)
- expect(page).to have_content(assigned_merge_request.title)
- expect(page).to have_content(assigned_merge_request_from_fork.title)
- expect(page).to have_content(other_merge_request.title)
+ expect(page).to have_content('Please select at least one filter to see results')
end
it 'shows sorted merge requests' do