Skip to content

Commit

Permalink
Merge pull request #4620 from pulibrary/i4597_advanced_search_languag…
Browse files Browse the repository at this point in the history
…e_tests

Tests that fail for the right reason for advanced search language
  • Loading branch information
rladdusaw authored Dec 6, 2024
2 parents 8ddfbea + 748d50b commit a52329d
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions spec/views/catalog/advanced_search.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe 'catalog/index' do
before do
stub_holding_locations
end

describe 'language facet' do
before do
# Needed since we cache the facets to help the page load faster
Rails.cache.clear
end
context 'with an empty search' do
before do
visit '/advanced'
end
it 'has the full list of languages' do
pending('Resolving https://github.com/pulibrary/orangelight/issues/4597')
within '#language_facet-list' do
language_list_elements = page.find_all('li')
expect(language_list_elements.size).to be > 10
end
end
end
context 'with an edited search' do
before do
visit '/advanced?q=a&search_field=all_fields'
end
it 'has the full list of languages' do
pending('Resolving https://github.com/pulibrary/orangelight/issues/4597')
within '#language_facet-list' do
language_list_elements = page.find_all('li')
expect(language_list_elements.size).to be > 10
end
end
end
context 'with regular search results' do
before do
visit '/catalog?search_field=all_fields&q=a'
end
it 'still only shows ten languages in the sidebar' do
within '#facet-language_facet' do
language_list_elements = page.find_all('li')
expect(language_list_elements.size).to eq(10)
end
end
end
end
end

0 comments on commit a52329d

Please sign in to comment.