diff --git a/app/frontend/controllers/accessible_autocomplete_controller.js b/app/frontend/controllers/accessible_autocomplete_controller.js index b510a6b02..f3a6ca1d8 100644 --- a/app/frontend/controllers/accessible_autocomplete_controller.js +++ b/app/frontend/controllers/accessible_autocomplete_controller.js @@ -22,6 +22,7 @@ export default class extends Controller { } }, autoselect: true, + placeholder: 'Start typing to search', templates: { suggestion: (value) => suggestion(value, options) }, name: rawFieldName, onConfirm: (val) => { diff --git a/spec/features/form/accessible_autocomplete_spec.rb b/spec/features/form/accessible_autocomplete_spec.rb index 373d0232d..e525da46f 100644 --- a/spec/features/form/accessible_autocomplete_spec.rb +++ b/spec/features/form/accessible_autocomplete_spec.rb @@ -63,6 +63,10 @@ RSpec.describe "Accessible Autocomplete" do page.go_back expect(page).to have_selector("input", class: "autocomplete__input", count: 1) end + + it "displays the placeholder text", js: true do + expect(find("#lettings-log-prevloc-field")["placeholder"]).to eq("Start typing to search") + end end context "when searching schemes" do