Replace deprecated .trigger('click') API with .click

This commit is contained in:
Angel Perez
2018-03-08 14:33:09 -04:00
parent 6a55b720b8
commit 38af45d450
12 changed files with 42 additions and 42 deletions

View File

@@ -149,7 +149,7 @@ feature 'Ballots' do
end end
within("#budget_investment_#{investment.id}") do within("#budget_investment_#{investment.id}") do
find('.remove a').trigger('click') find('.remove a').click
end end
expect(page).to have_css("#amount-spent", text: "€0") expect(page).to have_css("#amount-spent", text: "€0")
@@ -274,7 +274,7 @@ feature 'Ballots' do
visit budget_investments_path(budget, heading_id: california.id) visit budget_investments_path(budget, heading_id: california.id)
within("#budget_investment_#{investment1.id}") do within("#budget_investment_#{investment1.id}") do
find('.remove a').trigger('click') find('.remove a').click
end end
visit budget_investments_path(budget, heading_id: new_york.id) visit budget_investments_path(budget, heading_id: new_york.id)
@@ -375,7 +375,7 @@ feature 'Ballots' do
expect(page).to have_content("You have voted one investment") expect(page).to have_content("You have voted one investment")
within("#budget_investment_#{investment.id}") do within("#budget_investment_#{investment.id}") do
find(".remove-investment-project").trigger('click') find(".remove-investment-project").click
end end
expect(page).to have_current_path(budget_ballot_path(budget)) expect(page).to have_current_path(budget_ballot_path(budget))
@@ -404,7 +404,7 @@ feature 'Ballots' do
end end
within("#sidebar #budget_investment_#{investment1.id}_sidebar") do within("#sidebar #budget_investment_#{investment1.id}_sidebar") do
find(".remove-investment-project").trigger('click') find(".remove-investment-project").click
end end
expect(page).to have_css("#amount-spent", text: "€20,000") 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") expect(page).to have_content("You have voted one investment")
within("#budget_investment_#{investment.id}") do within("#budget_investment_#{investment.id}") do
find(".remove-investment-project").trigger('click') find(".remove-investment-project").click
end end
expect(page).to have_content("You have voted 0 investments") expect(page).to have_content("You have voted 0 investments")
@@ -581,7 +581,7 @@ feature 'Ballots' do
end end
within("#budget_investment_#{bi1.id}") do within("#budget_investment_#{bi1.id}") do
find('.remove a').trigger('click') find('.remove a').click
expect(page).to have_css ".add a" expect(page).to have_css ".add a"
end end
@@ -609,7 +609,7 @@ feature 'Ballots' do
end end
within("#budget_investment_#{bi1.id}_sidebar") do within("#budget_investment_#{bi1.id}_sidebar") do
find('.remove-investment-project').trigger('click') find('.remove-investment-project').click
end end
expect(page).not_to have_css "#budget_investment_#{bi1.id}_sidebar" expect(page).not_to have_css "#budget_investment_#{bi1.id}_sidebar"
@@ -633,7 +633,7 @@ feature 'Ballots' do
within("#budget_investment_#{investment1.id}") do within("#budget_investment_#{investment1.id}") do
expect(page).to have_selector('.in-favor a', visible: true) expect(page).to have_selector('.in-favor a', visible: true)
find('.add a').trigger('click') find('.add a').click
expect(page.status_code).to eq(200) expect(page.status_code).to eq(200)
expect(page).not_to have_content "Remove" expect(page).not_to have_content "Remove"

View File

@@ -939,7 +939,7 @@ feature 'Budget Investments' do
login_as(user) login_as(user)
visit budget_investment_path(budget_id: investment.budget.id, id: investment.id) visit budget_investment_path(budget_id: investment.budget.id, id: investment.id)
find("#tab-milestones-label").trigger('click') find("#tab-milestones-label").click
within("#tab-milestones") do within("#tab-milestones") do
expect(first_milestone.description).to appear_before('Last milestone with a link to https://consul.dev') expect(first_milestone.description).to appear_before('Last milestone with a link to https://consul.dev')
@@ -959,7 +959,7 @@ feature 'Budget Investments' do
login_as(user) login_as(user)
visit budget_investment_path(budget_id: investment.budget.id, id: investment.id) visit budget_investment_path(budget_id: investment.budget.id, id: investment.id)
find("#tab-milestones-label").trigger('click') find("#tab-milestones-label").click
within("#tab-milestones") do within("#tab-milestones") do
expect(page).to have_content("Don't have defined milestones") expect(page).to have_content("Don't have defined milestones")

View File

@@ -53,17 +53,17 @@ feature 'Commenting Budget::Investments' do
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 2) expect(page).to have_css('.comment', count: 2)
expect(page).not_to have_content grandchild_comment.body expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
expect(page).to have_content grandchild_comment.body expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").trigger('click') find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 1) expect(page).to have_css('.comment', count: 1)
expect(page).not_to have_content child_comment.body expect(page).not_to have_content child_comment.body

View File

@@ -80,17 +80,17 @@ feature 'Internal valuation comments on Budget::Investments' do
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 2) expect(page).to have_css('.comment', count: 2)
expect(page).not_to have_content grandchild_comment.body expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
expect(page).to have_content grandchild_comment.body expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").trigger('click') find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 1) expect(page).to have_css('.comment', count: 1)
expect(page).not_to have_content child_comment.body expect(page).not_to have_content child_comment.body

View File

@@ -48,17 +48,17 @@ feature 'Commenting debates' do
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 2) expect(page).to have_css('.comment', count: 2)
expect(page).not_to have_content grandchild_comment.body expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
expect(page).to have_content grandchild_comment.body expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").trigger('click') find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 1) expect(page).to have_css('.comment', count: 1)
expect(page).not_to have_content child_comment.body expect(page).not_to have_content child_comment.body

View File

@@ -55,17 +55,17 @@ feature 'Commenting legislation questions' do
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 2) expect(page).to have_css('.comment', count: 2)
expect(page).not_to have_content grandchild_comment.body expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
expect(page).to have_content grandchild_comment.body expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").trigger('click') find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 1) expect(page).to have_css('.comment', count: 1)
expect(page).not_to have_content child_comment.body expect(page).not_to have_content child_comment.body
@@ -620,7 +620,7 @@ feature 'Commenting legislation questions' do
scenario 'View comments of annotations in an included range' do scenario 'View comments of annotations in an included range' do
within("#annotation-link") do within("#annotation-link") do
first(:css, "a").trigger('click') first(:css, "a").click
end end
expect(page).to have_css(".comment", count: 2) expect(page).to have_css(".comment", count: 2)
@@ -656,7 +656,7 @@ feature 'Commenting legislation questions' do
end end
within("#annotation-link") do within("#annotation-link") do
first(:css, "a").trigger('click') first(:css, "a").click
end end
expect(page).to have_css(".comment", count: 3) 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 scenario "Reply on a multiple annotation thread and display it in the single annotation thread" do
within("#annotation-link") do within("#annotation-link") do
first(:css, "a").trigger('click') first(:css, "a").click
end end
comment = annotation2.comments.first comment = annotation2.comments.first

View File

@@ -55,17 +55,17 @@ feature 'Commenting legislation questions' do
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 2) expect(page).to have_css('.comment', count: 2)
expect(page).not_to have_content grandchild_comment.body expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
expect(page).to have_content grandchild_comment.body expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").trigger('click') find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 1) expect(page).to have_css('.comment', count: 1)
expect(page).not_to have_content child_comment.body expect(page).not_to have_content child_comment.body

View File

@@ -49,17 +49,17 @@ feature 'Commenting polls' do
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 2) expect(page).to have_css('.comment', count: 2)
expect(page).not_to have_content grandchild_comment.body expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
expect(page).to have_content grandchild_comment.body expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").trigger('click') find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 1) expect(page).to have_css('.comment', count: 1)
expect(page).not_to have_content child_comment.body expect(page).not_to have_content child_comment.body

View File

@@ -47,17 +47,17 @@ feature 'Commenting proposals' do
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 2) expect(page).to have_css('.comment', count: 2)
expect(page).not_to have_content grandchild_comment.body expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
expect(page).to have_content grandchild_comment.body expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").trigger('click') find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 1) expect(page).to have_css('.comment', count: 1)
expect(page).not_to have_content child_comment.body expect(page).not_to have_content child_comment.body

View File

@@ -51,17 +51,17 @@ feature 'Commenting topics from proposals' do
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 2) expect(page).to have_css('.comment', count: 2)
expect(page).not_to have_content grandchild_comment.body expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
expect(page).to have_content grandchild_comment.body expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").trigger('click') find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 1) expect(page).to have_css('.comment', count: 1)
expect(page).not_to have_content child_comment.body expect(page).not_to have_content child_comment.body
@@ -601,17 +601,17 @@ feature 'Commenting topics from budget investments' do
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 2) expect(page).to have_css('.comment', count: 2)
expect(page).not_to have_content grandchild_comment.body expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").trigger('click') find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 3) expect(page).to have_css('.comment', count: 3)
expect(page).to have_content grandchild_comment.body expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").trigger('click') find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css('.comment', count: 1) expect(page).to have_css('.comment', count: 1)
expect(page).not_to have_content child_comment.body expect(page).not_to have_content child_comment.body

View File

@@ -194,7 +194,7 @@ feature 'Legislation Draft Versions' do
expect(page).to have_content "my annotation" expect(page).to have_content "my annotation"
expect(page).to have_content comment.body expect(page).to have_content comment.body
all(".annotator-hl")[1].trigger('click') all(".annotator-hl")[1].click
expect(page).to have_content "my other annotation" expect(page).to have_content "my other annotation"
end end

View File

@@ -293,7 +293,7 @@ module CommonActions
def add_to_ballot(budget_investment) def add_to_ballot(budget_investment)
within("#budget_investment_#{budget_investment.id}") do within("#budget_investment_#{budget_investment.id}") do
find('.add a').trigger('click') find('.add a').click
expect(page).to have_content "Remove" expect(page).to have_content "Remove"
end end
end end