-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4620 from pulibrary/i4597_advanced_search_languag…
…e_tests Tests that fail for the right reason for advanced search language
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |