Skip to content

Commit

Permalink
Merge pull request #1517 from projectblacklight/1512-bugfix-view-all-…
Browse files Browse the repository at this point in the history
…link

Bugfix: retain existing facet selections when clicking View All X lin…
  • Loading branch information
corylown authored Mar 13, 2024
2 parents 7b3fa99 + 7f4146d commit c5e6c80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/components/arclight/group_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def presenter
end

def search_within_collection_url
search_catalog_path(helpers.search_without_group.merge(f: { collection: [document.collection_name] }))
search_catalog_path(helpers.search_without_group.deep_merge(f: { collection: [document.collection_name] }))
end
end
end
9 changes: 9 additions & 0 deletions spec/features/grouped_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@
)
end

it 'retains existing facet selections when viewing all in a collection' do
visit search_catalog_path q: 'large sample', group: 'true', f: { level: ['File'] }
expect(page).to have_css '.al-grouped-more', text: /Top 3 results/
expect(page).to have_css(
'.al-grouped-more a[href*="/catalog?f%5Bcollection%5D%5B%5D=Large+collection+sample%2C+1843-1872&f%5Blevel%5D%5B%5D=File&q=large+sample"]',
text: 'view all 202'
)
end

context 'when in compact view' do
it 'does not render the collection abstract/scope' do
visit search_catalog_path q: 'alpha omega', group: 'true', view: 'compact'
Expand Down

0 comments on commit c5e6c80

Please sign in to comment.