Replace link with button in ballot investment component

This commit is contained in:
cyrillefr
2025-03-20 13:46:35 +01:00
parent f8e2a7b5ba
commit 9d0214374b
3 changed files with 6 additions and 5 deletions

View File

@@ -33,6 +33,7 @@
position: absolute;
right: $close-icon-margin;
top: $close-icon-margin;
cursor: pointer;
}
&:hover {

View File

@@ -3,7 +3,7 @@
<%= investment_price %>
<% if budget.balloting? %>
<%= link_to delete_path,
<%= button_to delete_path,
title: t("budgets.ballots.show.remove"),
class: "remove-budget-investment",
method: :delete,

View File

@@ -379,7 +379,7 @@ describe "Ballots" do
expect(page).to have_content("You have voted one investment")
within("#budget_investment_#{investment.id}") do
click_link "Remove vote"
click_button "Remove vote"
end
expect(page).to have_current_path(budget_ballot_path(budget))
@@ -406,7 +406,7 @@ describe "Ballots" do
end
within("#sidebar #budget_investment_#{investment1.id}_sidebar") do
click_link "Remove vote"
click_button "Remove vote"
end
expect(page).to have_css("#total_amount", text: "€20,000")
@@ -436,7 +436,7 @@ describe "Ballots" do
expect(page).to have_content("You have voted one investment")
within(".ballot-list li", text: "Sully monument") do
click_link "Remove vote"
click_button "Remove vote"
end
expect(page).to have_content("You have voted 0 investments")
@@ -623,7 +623,7 @@ describe "Ballots" do
end
within("#budget_investment_#{bi1.id}_sidebar") do
click_link "Remove vote"
click_button "Remove vote"
end
expect(page).not_to have_css "#budget_investment_#{bi1.id}_sidebar"