Browse Source

Additional test for accessible automcomplete defaulting

pull/582/head
baarkerlounger 3 years ago
parent
commit
5649452d2a
  1. 2
      app/views/filters/_select_filter.html.erb
  2. 1
      spec/features/user_spec.rb

2
app/views/filters/_select_filter.html.erb

@ -4,4 +4,4 @@
:name, :name,
label: { hidden: secondary }, label: { hidden: secondary },
options: { disabled: [""], selected: selected_option(category) }, options: { disabled: [""], selected: selected_option(category) },
"data-controller": ["accessible-autocomplete", "conditional-filter"] %> "data-controller": %w[accessible-autocomplete conditional-filter] %>

1
spec/features/user_spec.rb

@ -539,6 +539,7 @@ RSpec.describe "User Features" do
it "clears the previously selected organisation value" do it "clears the previously selected organisation value" do
visit("/logs") visit("/logs")
choose("organisation-select-specific-org-field", allow_label_click: true) 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) find("#organisation-field").click.native.send_keys("F", "i", "l", "t", :down, :enter)
click_button("Apply filters") 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}") expect(page).to have_current_path("/logs?%5Byears%5D%5B%5D=&%5Bstatus%5D%5B%5D=&user=all&organisation_select=specific_org&organisation=#{organisation.id}")

Loading…
Cancel
Save