From b9c3e759302a91d6e206576a24d2ff1b8f7c2909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 6 Oct 2024 14:35:22 +0200 Subject: [PATCH] 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. --- .../admin/budget_investments/row_component.html.erb | 2 +- spec/system/admin/budget_investments_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/components/admin/budget_investments/row_component.html.erb b/app/components/admin/budget_investments/row_component.html.erb index b707b56bc..cc37536f9 100644 --- a/app/components/admin/budget_investments/row_component.html.erb +++ b/app/components/admin/budget_investments/row_component.html.erb @@ -54,7 +54,7 @@ <% end %> - + <% if investment.selected? %> <%= link_to_if can?(:toggle_selection, investment), t("admin.budget_investments.index.selected"), diff --git a/spec/system/admin/budget_investments_spec.rb b/spec/system/admin/budget_investments_spec.rb index 506562d17..1a5a16a89 100644 --- a/spec/system/admin/budget_investments_spec.rb +++ b/spec/system/admin/budget_investments_spec.rb @@ -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