File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ def add_search_field_with_json_query_parameters(solr_parameters)
102102
103103 # Transform "clause" parameters into the Solr JSON Query DSL
104104 def add_adv_search_clauses ( solr_parameters )
105- return if search_state . clause_params . blank?
105+ return if search_state . clause_params . blank? || search_state . clause_params . all? { | _k , v | v [ :query ] . blank? }
106106
107107 # We need to specify lucene as the top-level defType when using JSON Query DSL in Solr versions
108108 # between 7.2.0 & 9.4.0. After 9.4.0 this is no longer necessary, but also not harmful to include.
Original file line number Diff line number Diff line change 103103 expect ( page ) . to have_content ( 'Pākistānī ʻaurat dorāhe par' )
104104 expect ( page ) . to have_css ( 'article.document' , count : 10 )
105105 end
106+
107+ it 'returns all records when no query is present' do
108+ click_on 'advanced-search-submit'
109+ expect ( page ) . to have_content ( '1 - 10 of 30' )
110+ end
111+
112+ it 'performs a faceted search when query is present' do
113+ within '#facet-language_ssim' do
114+ check 'Urdu 3'
115+ end
116+ click_on 'advanced-search-submit'
117+ expect ( page ) . to have_css ( 'article.document' , count : 3 )
118+ end
106119 end
107120
108121 describe "prepopulated advanced search form" do
You can’t perform that action at this time.
0 commit comments