diff --git a/app/components/sdg/related_list_selector_component.html.erb b/app/components/sdg/related_list_selector_component.html.erb index e86ee3288..54c600aae 100644 --- a/app/components/sdg/related_list_selector_component.html.erb +++ b/app/components/sdg/related_list_selector_component.html.erb @@ -16,7 +16,8 @@ link: link_to(t("sdg.related_list_selector.help.text"), sdg_help_path, title: t("shared.target_blank"), - target: "_blank"))), + target: "_blank")), + attributes: %w[href title target]), data: { "suggestions-list": sdg_related_suggestions, "remove-tag-text": t("sdg.related_list_selector.remove_tag") } %> diff --git a/spec/system/sdg_management/relations_spec.rb b/spec/system/sdg_management/relations_spec.rb index 6afc0475c..8e01c5fab 100644 --- a/spec/system/sdg_management/relations_spec.rb +++ b/spec/system/sdg_management/relations_spec.rb @@ -413,6 +413,16 @@ describe "SDG Relations", :js do expect(find("input[data-code='1']")).to be_checked end end + + scenario "Help page link opens in new window" do + process = create(:legislation_process, title: "SDG process") + + visit sdg_management_edit_legislation_process_path(process) + + within_window(window_opened_by { click_link "SDG help page" }) do + expect(page).to have_content "Sustainable Development Goals help" + end + end end describe "help section" do