From 5649452d2a218397479338275b853fda62040e75 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Wed, 18 May 2022 12:24:28 +0100 Subject: [PATCH] Additional test for accessible automcomplete defaulting --- app/views/filters/_select_filter.html.erb | 2 +- spec/features/user_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/filters/_select_filter.html.erb b/app/views/filters/_select_filter.html.erb index fa2dbf539..f5f6c441f 100644 --- a/app/views/filters/_select_filter.html.erb +++ b/app/views/filters/_select_filter.html.erb @@ -4,4 +4,4 @@ :name, label: { hidden: secondary }, options: { disabled: [""], selected: selected_option(category) }, - "data-controller": ["accessible-autocomplete", "conditional-filter"] %> + "data-controller": %w[accessible-autocomplete conditional-filter] %> diff --git a/spec/features/user_spec.rb b/spec/features/user_spec.rb index e4dae7490..6e197f07d 100644 --- a/spec/features/user_spec.rb +++ b/spec/features/user_spec.rb @@ -539,6 +539,7 @@ RSpec.describe "User Features" do it "clears the previously selected organisation value" do visit("/logs") choose("organisation-select-specific-org-field", allow_label_click: true) + expect(page).to have_field("organisation-field", with: "") find("#organisation-field").click.native.send_keys("F", "i", "l", "t", :down, :enter) click_button("Apply filters") expect(page).to have_current_path("/logs?%5Byears%5D%5B%5D=&%5Bstatus%5D%5B%5D=&user=all&organisation_select=specific_org&organisation=#{organisation.id}")