-
Notifications
You must be signed in to change notification settings - Fork 2
Fix filters not preserved when paginated #103
Conversation
The pagination is now better covered by the filters tests.
There was a problem hiding this 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
There was a problem hiding this 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', () => |
There was a problem hiding this comment.
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', () => { |
There was a problem hiding this comment.
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', () => { |
There was a problem hiding this comment.
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`, () => { |
There was a problem hiding this comment.
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
Fixes a bug when filters were reset when the user clicked on the numbered pagination links.