Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Fix filters not preserved when paginated #103

Merged
merged 5 commits into from
May 18, 2020
Merged

Conversation

peterhudec
Copy link
Contributor

Fixes a bug when filters were reset when the user clicked on the numbered pagination links.

Verified

This commit was signed with the committer’s verified signature.
AnaisUrlichs Anais Urlichs
The pagination is now better covered by the filters tests.
Copy link
Contributor

@ian-leggett ian-leggett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just one comment around the semicolon

Copy link
Contributor

@ian-leggett ian-leggett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good from me pending Graham's comments


const testResults = (assert, expectedTotal, testPages) => {
context('Results', () => {
it('Total', () =>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should read as a sentence, "it total" is a bit vague

})

pages.slice(0, -1).reverse().forEach(itemsPerPage =>
it('Previous', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should read as a sentence

)

pages.slice(1).forEach(itemsPerPage =>
it('Next', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should read as a sentence


assertResults(() => {}, Object.keys(ENQUIRIES).length)
const testPagination = ({ filters, totalPages, pages }) =>
it(`Filters should be preserved on pagination`, () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should read as a sentence

@peterhudec peterhudec merged commit 561410f into master May 18, 2020
@cgsunkel cgsunkel deleted the fix/filters-pagination branch July 11, 2022 10:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants