Skip to content

Commit

Permalink
Various config changes (#306)
Browse files Browse the repository at this point in the history
* remove unused migration config files

* update items per page config

* update build kit image tag

* fix pagination issues tests

* fix tests again
  • Loading branch information
jaredgalanis authored Mar 15, 2022
1 parent e6436ad commit fc85772
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ REPOSITORY=ghcr.io/jhu-sheridan-libraries/idc-isle-dc

# The version of the isle-buildkit images, non isle-buildkit images have
# their versions specified explicitly in their respective docker-compose files.
TAG=upstream-20200824-f8d1e8e-80-gec5f290
TAG=upstream-20200824-f8d1e8e-83-g8c8a6b4

# Docker image and tag for snapshot image
SNAPSHOT_TAG=upstream-20201007-739693ae-405-g521b43f.1630614319
Expand Down

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions codebase/config/sync/views.view.solr_search_content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ display:
pager:
type: mini
options:
items_per_page: 10
items_per_page: 25
offset: 0
id: 0
total_pages: null
Expand Down Expand Up @@ -1464,7 +1464,7 @@ display:
pager:
type: full
options:
items_per_page: 10
items_per_page: 25
offset: 0
id: 0
total_pages: null
Expand Down
13 changes: 11 additions & 2 deletions end-to-end/tests/ui/advanced-search.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ fixture `Advanced Search page`
* Clear button press (10 results)
*/
test('Proximity search and Clear button', async (t) => {
await Page.listOptions.itemsPerPage.setValue('10');

await t.expect(Page.results.count).eql(10);

const term1 = Page.queryTerm(0);
Expand Down Expand Up @@ -56,6 +58,8 @@ test('Proximity search and Clear button', async (t) => {
* Normal search 'animal' OR 'page' (5 results)
*/
test('Normal search', async (t) => {
await Page.listOptions.itemsPerPage.setValue('10');

await t.expect(Page.results.count).eql(10);

await Page.pagers[0].goToPage(3);
Expand Down Expand Up @@ -95,6 +99,8 @@ test('Can initiate search with Enter key', async (t) => {
test('Collection filter', async (t) => {
const pager = Page.pagers[0];

await Page.listOptions.itemsPerPage.setValue('10');

await pager.goToPage(3);

await t
Expand Down Expand Up @@ -127,6 +133,9 @@ test('Collection filter', async (t) => {
*/
test('Date filter and basic search', async (t) => {
const term = Page.queryTerm(0);

await Page.listOptions.itemsPerPage.setValue('10');

await t
.typeText(term.nonproxyTerm.term, 'item', { paste: true})
.click(Page.submitBtn)
Expand All @@ -138,14 +147,14 @@ test('Date filter and basic search', async (t) => {
.pressKey('tab')
.expect(Page.results.count).eql(5)
.click(Page.clearTerms)
.expect(Page.results.count).eql(10)
.click(Page.clearFilters)
.expect(Page.results.count).eql(10);
});

test('Date filter will reset current page', async (t) => {
const pager = Page.pagers[0];

await Page.listOptions.itemsPerPage.setValue('10');

await t.expect(Page.results.count).eql(10);
await pager.goToPage(3);
await t
Expand Down
8 changes: 6 additions & 2 deletions end-to-end/tests/ui/collections.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ async function doSearch(t, query) {

test('Has expected number of collections', async (t) => {
await t
.expect(page.results.count).eql(10)
.expect(page.results.count).eql(14)
.expect(page.pagers[0]).ok()
.expect(page.pagers[0].pager.textContent).contains('1 – 10 of');
.expect(page.pagers[0].pager.textContent).contains('1 – 14 of');
});

test('Pager controls work', async (t) => {
const pager = page.pagers[0];

await page.listOptions.itemsPerPage.setValue('10');

await t
.expect(pager).ok('No pager found on page')
.expect(pager.buttons.count).eql(4);
Expand Down Expand Up @@ -107,6 +109,8 @@ test('List option: items per page', async (t) => {
});

test('List option: go to page', async (t) => {
await page.listOptions.itemsPerPage.setValue('10');

await t.expect(page.pagers[0].pager.withText('1 – 10').exists).ok();

await page.listOptions.currentPage.setValue('2');
Expand Down
8 changes: 8 additions & 0 deletions end-to-end/tests/ui/search-page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ fixture `Search Page`

test('Returns all items by default', async (t) => {
const pager = Page.pagers[0];

await Page.listOptions.itemsPerPage.setValue('10');

await t
.expect(Page.titleBar.withText('Search Results').exists).ok()
.expect(pager.pager.withText('of 24 items').exists).ok()
Expand All @@ -13,6 +16,9 @@ test('Returns all items by default', async (t) => {

test('Entering a new search term resets current page', async (t) => {
const pager = Page.pagers[0];

await Page.listOptions.itemsPerPage.setValue('10');

await t
// First search for 'moo'
.typeText(Page.searchInput, 'moo', { paste: true })
Expand All @@ -31,6 +37,8 @@ test('Entering a new search term resets current page', async (t) => {
test('Selecting or deselecting a facet resets current page', async (t) => {
const pager = Page.pagers[0];

await Page.listOptions.itemsPerPage.setValue('10');

const facet = {
category: 'Resource Type',
value: 'Dataset'
Expand Down

0 comments on commit fc85772

Please sign in to comment.