Commit b1528859 authored by Robert Speicher's avatar Robert Speicher

Combine multiple `it` blocks in filter_issues_spec

parent 18dd86b6
...@@ -251,15 +251,10 @@ describe 'Filter issues', js: true do ...@@ -251,15 +251,10 @@ describe 'Filter issues', js: true do
end end
context 'issue label clicked' do context 'issue label clicked' do
before do it 'filters and displays in search bar' do
find('.issues-list .issue .issue-main-info .issuable-info a .label', text: multiple_words_label.title).click find('.issues-list .issue .issue-main-info .issuable-info a .label', text: multiple_words_label.title).click
end
it 'filters' do
expect_issues_list_count(1) expect_issues_list_count(1)
end
it 'displays in search bar' do
expect_tokens([label_token("\"#{multiple_words_label.title}\"")]) expect_tokens([label_token("\"#{multiple_words_label.title}\"")])
expect_filtered_search_input_empty expect_filtered_search_input_empty
end end
...@@ -435,7 +430,7 @@ describe 'Filter issues', js: true do ...@@ -435,7 +430,7 @@ describe 'Filter issues', js: true do
end end
end end
describe 'retains filter when switching issue states' do describe 'switching issue states' do
let!(:closed_issue) { create(:issue, :closed, project: project, title: 'closed bug') } let!(:closed_issue) { create(:issue, :closed, project: project, title: 'closed bug') }
before do before do
...@@ -445,25 +440,21 @@ describe 'Filter issues', js: true do ...@@ -445,25 +440,21 @@ describe 'Filter issues', js: true do
expect_issues_list_count(4, 1) expect_issues_list_count(4, 1)
end end
it 'open state' do it 'maintains filter' do
# Closed
find('.issues-state-filters [data-state="closed"]').click find('.issues-state-filters [data-state="closed"]').click
wait_for_requests wait_for_requests
expect(page).to have_selector('.issues-list .issue', count: 1)
expect(page).to have_link(closed_issue.title)
# Opened
find('.issues-state-filters [data-state="opened"]').click find('.issues-state-filters [data-state="opened"]').click
wait_for_requests wait_for_requests
expect(page).to have_selector('.issues-list .issue', count: 4) expect(page).to have_selector('.issues-list .issue', count: 4)
end
it 'closed state' do
find('.issues-state-filters [data-state="closed"]').click
wait_for_requests
expect(page).to have_selector('.issues-list .issue', count: 1)
expect(find('.issues-list .issue:first-of-type .issue-title-text a')).to have_content(closed_issue.title)
end
it 'all state' do # All
find('.issues-state-filters [data-state="all"]').click find('.issues-state-filters [data-state="all"]').click
wait_for_requests wait_for_requests
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment