Skip to content

Conversation

@romeoonisim
Copy link
Contributor

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.

Comment on lines +28 to +41

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);
});
Copy link
Member

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?

Comment on lines -17 to 28

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'
});

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants