Commit 9931ea23 authored by David Kim's avatar David Kim

Merge branch 'cngo-update-feature-specs' into 'master'

Update feature specs for issues refactor

See merge request gitlab-org/gitlab!66080
parents 9eafffb9 97b6fc84
...@@ -81,14 +81,14 @@ RSpec.describe 'Dashboard Issues filtering', :js do ...@@ -81,14 +81,14 @@ RSpec.describe 'Dashboard Issues filtering', :js do
sort_by('Created date') sort_by('Created date')
visit_issues(assignee_username: user.username) visit_issues(assignee_username: user.username)
expect(find('.issues-filters')).to have_content('Created date') expect(page).to have_button('Created date')
end end
it 'keeps sorting issues after visiting Projects Issues page' do it 'keeps sorting issues after visiting Projects Issues page' do
sort_by('Created date') sort_by('Created date')
visit project_issues_path(project) visit project_issues_path(project)
expect(find('.issues-filters')).to have_content('Created date') expect(page).to have_button('Created date')
end end
end end
......
...@@ -22,11 +22,11 @@ RSpec.describe "User sorts issues" do ...@@ -22,11 +22,11 @@ RSpec.describe "User sorts issues" do
create(:award_emoji, :upvote, awardable: issue2) create(:award_emoji, :upvote, awardable: issue2)
sign_in(user) sign_in(user)
visit(project_issues_path(project))
end end
it 'keeps the sort option' do it 'keeps the sort option' do
visit(project_issues_path(project))
find('.filter-dropdown-container .dropdown').click find('.filter-dropdown-container .dropdown').click
page.within('ul.dropdown-menu.dropdown-menu-right li') do page.within('ul.dropdown-menu.dropdown-menu-right li') do
...@@ -47,11 +47,10 @@ RSpec.describe "User sorts issues" do ...@@ -47,11 +47,10 @@ RSpec.describe "User sorts issues" do
end end
it 'sorts by popularity', :js do it 'sorts by popularity', :js do
find('.filter-dropdown-container .dropdown').click visit(project_issues_path(project))
page.within('ul.dropdown-menu.dropdown-menu-right li') do click_button 'Created date'
click_link("Popularity") click_on 'Popularity'
end
page.within(".issues-list") do page.within(".issues-list") do
page.within("li.issue:nth-child(1)") do page.within("li.issue:nth-child(1)") do
...@@ -129,7 +128,7 @@ RSpec.describe "User sorts issues" do ...@@ -129,7 +128,7 @@ RSpec.describe "User sorts issues" do
it 'filters by none' do it 'filters by none' do
visit project_issues_path(project, due_date: Issue::NoDueDate.name) visit project_issues_path(project, due_date: Issue::NoDueDate.name)
page.within '.issues-holder' do page.within '.issues-list' do
expect(page).not_to have_content('foo') expect(page).not_to have_content('foo')
expect(page).not_to have_content('bar') expect(page).not_to have_content('bar')
expect(page).to have_content('baz') expect(page).to have_content('baz')
...@@ -139,7 +138,7 @@ RSpec.describe "User sorts issues" do ...@@ -139,7 +138,7 @@ RSpec.describe "User sorts issues" do
it 'filters by any' do it 'filters by any' do
visit project_issues_path(project, due_date: Issue::AnyDueDate.name) visit project_issues_path(project, due_date: Issue::AnyDueDate.name)
page.within '.issues-holder' do page.within '.issues-list' do
expect(page).to have_content('foo') expect(page).to have_content('foo')
expect(page).to have_content('bar') expect(page).to have_content('bar')
expect(page).to have_content('baz') expect(page).to have_content('baz')
...@@ -153,7 +152,7 @@ RSpec.describe "User sorts issues" do ...@@ -153,7 +152,7 @@ RSpec.describe "User sorts issues" do
visit project_issues_path(project, due_date: Issue::DueThisWeek.name) visit project_issues_path(project, due_date: Issue::DueThisWeek.name)
page.within '.issues-holder' do page.within '.issues-list' do
expect(page).to have_content('foo') expect(page).to have_content('foo')
expect(page).to have_content('bar') expect(page).to have_content('bar')
expect(page).not_to have_content('baz') expect(page).not_to have_content('baz')
...@@ -167,7 +166,7 @@ RSpec.describe "User sorts issues" do ...@@ -167,7 +166,7 @@ RSpec.describe "User sorts issues" do
visit project_issues_path(project, due_date: Issue::DueThisMonth.name) visit project_issues_path(project, due_date: Issue::DueThisMonth.name)
page.within '.issues-holder' do page.within '.issues-list' do
expect(page).to have_content('foo') expect(page).to have_content('foo')
expect(page).to have_content('bar') expect(page).to have_content('bar')
expect(page).not_to have_content('baz') expect(page).not_to have_content('baz')
...@@ -181,7 +180,7 @@ RSpec.describe "User sorts issues" do ...@@ -181,7 +180,7 @@ RSpec.describe "User sorts issues" do
visit project_issues_path(project, due_date: Issue::Overdue.name) visit project_issues_path(project, due_date: Issue::Overdue.name)
page.within '.issues-holder' do page.within '.issues-list' do
expect(page).not_to have_content('foo') expect(page).not_to have_content('foo')
expect(page).not_to have_content('bar') expect(page).not_to have_content('bar')
expect(page).to have_content('baz') expect(page).to have_content('baz')
...@@ -195,7 +194,7 @@ RSpec.describe "User sorts issues" do ...@@ -195,7 +194,7 @@ RSpec.describe "User sorts issues" do
visit project_issues_path(project, due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name) visit project_issues_path(project, due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name)
page.within '.issues-holder' do page.within '.issues-list' do
expect(page).not_to have_content('foo') expect(page).not_to have_content('foo')
expect(page).not_to have_content('bar') expect(page).not_to have_content('bar')
expect(page).to have_content('baz') expect(page).to have_content('baz')
......
...@@ -60,7 +60,7 @@ RSpec.describe 'User sorts merge requests' do ...@@ -60,7 +60,7 @@ RSpec.describe 'User sorts merge requests' do
visit(project_issues_path(project)) visit(project_issues_path(project))
expect(find('.issues-filters a.is-active')).not_to have_content('Milestone') expect(page).not_to have_button('Milestone')
end end
context 'when merge requests have awards' do context 'when merge requests have awards' do
......
...@@ -6,7 +6,7 @@ RSpec::Matchers.define :have_issuable_counts do |opts| ...@@ -6,7 +6,7 @@ RSpec::Matchers.define :have_issuable_counts do |opts|
end end
match do |actual| match do |actual|
actual.within '.issues-state-filters' do actual.within '.top-area' do
expected_counts.each do |expected_count| expected_counts.each do |expected_count|
expect(actual).to have_content(expected_count) expect(actual).to have_content(expected_count)
end end
......
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