-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/Add pagination #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
|
||
| test('fetch more data when scrolled down', async function(assert) { | ||
| await page.visit(); | ||
|
|
||
| assert.equal(page.books().count, 9); | ||
|
|
||
| document.querySelector(page.loaderClass).scrollIntoView(); | ||
|
|
||
| await waitUntil(() => { | ||
| return page.books().count === 18; | ||
| }); | ||
|
|
||
| assert.equal(page.books().count, 18); | ||
| }); |
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.
The tests seem to use the actual api, meaning that they will hit the api every time the test runs.
Can you think of why this might not be a good idea in real live app and what are some alternatives?
|
|
||
| return this.store.query('book', { | ||
| page: { | ||
| size: ENV.BOOKS_PER_PAGE, | ||
| }, | ||
| return this.infinity.model('book', { | ||
| filter: { | ||
| 'author.name': query | ||
| }, | ||
| include: 'author,photos' | ||
| include: 'author,photos', | ||
| perPage: ENV.BOOKS_PER_PAGE, | ||
| startingPage: 1, | ||
| perPageParam: 'page[size]', | ||
| pageParam: 'page[number]', | ||
| countParam: 'meta.total_resources' | ||
| }); |
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.
This looks very similar with a query made in the books, maybe we can find a way to remove duplication.
Description
We've added infinity scroll pagination on elements and fixed the bug with the broken images. We replaced them with a static placeholder image.