diff --git a/app/components/orangelight/advanced_search_form_component.html.erb b/app/components/orangelight/advanced_search_form_component.html.erb
index b593d3c42..e50175252 100644
--- a/app/components/orangelight/advanced_search_form_component.html.erb
+++ b/app/components/orangelight/advanced_search_form_component.html.erb
@@ -15,10 +15,7 @@
+
+
+ <%= select_tag(
+ 'clause[0][field]',
+ options_for_select(
+ advanced_key_value,
+ guided_field(:clause_0_field, 'all_fields')
+ ),
+ class: "search_field") %>
+
+
+ <%= text_field_tag(
+ "clause[0][query]",
+ label_tag_default_for(:clause_0_query),
+ class: 'form-control',
+ autocorrect: "off",
+ autocapitalize: "off",
+ autocomplete: "off",
+ spellcheck: "false") %>
+
+
+
+
+
+
+
+
+
+ <%= select_tag(
+ 'clause[1][field]',
+ options_for_select(
+ advanced_key_value,
+ guided_field(:clause_1_field, 'author')
+ ),
+ class: "search_field") %>
+
+
+ <%= text_field_tag(
+ "clause[1][query]",
+ label_tag_default_for(:clause_1_query),
+ class: 'form-control',
+ autocorrect: "off",
+ autocapitalize: "off",
+ autocomplete: "off",
+ spellcheck: "false") %>
+
+
+
+
+
+
+
+
+
+ <%= select_tag(
+ 'clause[2][field]',
+ options_for_select(
+ advanced_key_value,
+ guided_field(:clause_2_field, 'title')
+ ),
+ class: "search_field") %>
+
+
+ <%= text_field_tag(
+ "clause[2][query]",
+ label_tag_default_for(:clause_2_query),
+ :class => 'form-control',
+ autocorrect: "off",
+ autocapitalize: "off",
+ spellcheck: "false") %>
+
+
+
diff --git a/spec/components/orangelight/advanced_search_form_component_spec.rb b/spec/components/orangelight/advanced_search_form_component_spec.rb
index ff8fae31f..6893f14ff 100644
--- a/spec/components/orangelight/advanced_search_form_component_spec.rb
+++ b/spec/components/orangelight/advanced_search_form_component_spec.rb
@@ -2,7 +2,7 @@
require "rails_helper"
-RSpec.describe Orangelight::AdvancedSearchFormComponent, type: :component do
+RSpec.describe Orangelight::AdvancedSearchFormComponent, type: :component, advanced_search: true do
subject(:render) do
component.render_in(view_context)
end
@@ -43,4 +43,11 @@
options = rendered.all('select')[1].all('option').map(&:text)
expect(options).to eq(expected_options)
end
+
+ it 'has text fields for each search field' do
+ expect(rendered).to have_selector '.advanced-search-field', count: 1
+ expect(rendered).to have_field 'clause_0_field', with: 'all_fields'
+ expect(rendered).to have_field 'clause_1_field', with: 'author'
+ expect(rendered).to have_field 'clause_2_field', with: 'title'
+ end
end
diff --git a/spec/features/advanced_searching_spec.rb b/spec/features/advanced_searching_spec.rb
index f12dbd04a..5d01331b1 100644
--- a/spec/features/advanced_searching_spec.rb
+++ b/spec/features/advanced_searching_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'advanced searching' do
+describe 'advanced searching', advanced_search: true do
before do
stub_holding_locations
end