diff --git a/app/assets/javascripts/sdg/related_list_selector.js b/app/assets/javascripts/sdg/related_list_selector.js index 1eb0ba88d..2abaff9f9 100644 --- a/app/assets/javascripts/sdg/related_list_selector.js +++ b/app/assets/javascripts/sdg/related_list_selector.js @@ -7,6 +7,9 @@ amsify_suggestags._settings({ suggestions: $(".sdg-related-list-selector .input").data("suggestions-list"), + whiteList: true, + keepLastOnHoverTag: false, + checkSimilar: false }); amsify_suggestags.classes.focus = ".sdg-related-list-focus"; amsify_suggestags.classes.sTagsInput = ".sdg-related-list-selector-input"; diff --git a/spec/system/sdg_management/relations_spec.rb b/spec/system/sdg_management/relations_spec.rb index 3fee5de4e..b2a800413 100644 --- a/spec/system/sdg_management/relations_spec.rb +++ b/spec/system/sdg_management/relations_spec.rb @@ -278,5 +278,14 @@ describe "SDG Relations", :js do expect(page).to have_css "td", exact_text: "1.1" end end + + scenario "allows adding only white list suggestions" do + process = create(:legislation_process, title: "SDG process") + + visit sdg_management_edit_legislation_process_path(process) + + fill_in "Sustainable Development Goals and Targets", with: "tag nonexistent," + within(".amsify-suggestags-input-area") { expect(page).not_to have_content "tag nonexistent" } + end end end