Fix duplicate HTML IDs in investments selection

Since this cell is shown once per row, there were multiple rows with the
same HTML ID on the page.
This commit is contained in:
Javi Martín
2024-10-06 14:35:22 +02:00
parent 73166e164b
commit b9c3e75930
2 changed files with 5 additions and 5 deletions

View File

@@ -54,7 +54,7 @@
<% end %>
</td>
<td id="selection" data-field="selected">
<td data-field="selected">
<% if investment.selected? %>
<%= link_to_if can?(:toggle_selection, investment),
t("admin.budget_investments.index.selected"),

View File

@@ -1451,22 +1451,22 @@ describe "Admin budget investments", :admin do
visit admin_budget_budget_investments_path(budget)
within("#budget_investment_#{unfeasible_bi.id} #selection") do
within("#budget_investment_#{unfeasible_bi.id} [data-field=selected]") do
expect(page).not_to have_content("Select")
expect(page).not_to have_content("Selected")
end
within("#budget_investment_#{feasible_bi.id} #selection") do
within("#budget_investment_#{feasible_bi.id} [data-field=selected]") do
expect(page).not_to have_content("Select")
expect(page).not_to have_content("Selected")
end
within("#budget_investment_#{feasible_vf_bi.id} #selection") do
within("#budget_investment_#{feasible_vf_bi.id} [data-field=selected]") do
expect(page).not_to have_content("Select")
expect(page).not_to have_content("Selected")
end
within("#budget_investment_#{selected_bi.id} #selection") do
within("#budget_investment_#{selected_bi.id} [data-field=selected]") do
expect(page).not_to contain_exactly("Select")
expect(page).to have_content("Selected")
end