Merge pull request #5927 from cyrillefr/ReplaceLinkWithButtonInInvestmentComponent

Replace link with button in ballot investment component
This commit is contained in:
Javi Martín
2025-03-30 21:31:02 +02:00
committed by GitHub
3 changed files with 10 additions and 9 deletions

View File

@@ -29,6 +29,7 @@
.remove-budget-investment {
@include has-fa-icon(times, solid);
cursor: pointer;
font-size: $close-icon-size;
position: absolute;
right: $close-icon-margin;

View File

@@ -3,11 +3,11 @@
<%= investment_price %>
<% if budget.balloting? %>
<%= link_to delete_path,
title: t("budgets.ballots.show.remove"),
class: "remove-budget-investment",
method: :delete,
remote: true do %>
<%= button_to delete_path,
title: t("budgets.ballots.show.remove"),
class: "remove-budget-investment",
method: :delete,
remote: true do %>
<span class="show-for-sr"><%= t("budgets.ballots.show.remove") %></span>
<% end %>
<% end %>

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"