Fix failing tests that simulated a click against the DOM

The now-deprecated `.trigger('click')` API simulated a click against
the DOM rather a click on the UI, which made our tests fragile and
wouldn't simulate actual user interaction
This commit is contained in:
Angel Perez
2018-03-16 13:19:58 -04:00
parent ff74d66405
commit 92af93e8bd
2 changed files with 7 additions and 7 deletions

View File

@@ -375,7 +375,7 @@ feature 'Ballots' do
expect(page).to have_content("You have voted one investment")
within("#budget_investment_#{investment.id}") do
find(".remove-investment-project").click
find('.icon-x').click
end
expect(page).to have_current_path(budget_ballot_path(budget))
@@ -404,7 +404,7 @@ feature 'Ballots' do
end
within("#sidebar #budget_investment_#{investment1.id}_sidebar") do
find(".remove-investment-project").click
find('.icon-x').click
end
expect(page).to have_css("#amount-spent", text: "€20,000")
@@ -431,7 +431,7 @@ feature 'Ballots' do
expect(page).to have_content("You have voted one investment")
within("#budget_investment_#{investment.id}") do
find(".remove-investment-project").click
find('.icon-x').click
end
expect(page).to have_content("You have voted 0 investments")
@@ -609,7 +609,7 @@ feature 'Ballots' do
end
within("#budget_investment_#{bi1.id}_sidebar") do
find('.remove-investment-project').click
find('.icon-x').click
end
expect(page).not_to have_css "#budget_investment_#{bi1.id}_sidebar"

View File

@@ -620,7 +620,7 @@ feature 'Commenting legislation questions' do
scenario 'View comments of annotations in an included range' do
within("#annotation-link") do
first(:css, "a").click
find('.icon-expand').click
end
expect(page).to have_css(".comment", count: 2)
@@ -656,7 +656,7 @@ feature 'Commenting legislation questions' do
end
within("#annotation-link") do
first(:css, "a").click
find('.icon-expand').click
end
expect(page).to have_css(".comment", count: 3)
@@ -667,7 +667,7 @@ feature 'Commenting legislation questions' do
scenario "Reply on a multiple annotation thread and display it in the single annotation thread" do
within("#annotation-link") do
first(:css, "a").click
find('.icon-expand').click
end
comment = annotation2.comments.first