Skip to content

Commit

Permalink
✅ Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
zivavu committed May 7, 2024
1 parent 8367ac7 commit 131135b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/tests/homePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ test('Posts are displayed on the home page', async (t) => {
test('Infinite scroll loads more posts', async (t) => {
await waitForPosts(Selector('[data-testid="feed-post"]'), 10000);
const initialPostCount = await Selector('[data-testid="feed-post"]').count;
await t.scroll(Selector('html'), 0, 5000);
const newPostCount = await Selector('[data-testid="feed-post"]').count;
await t.expect(newPostCount).gt(initialPostCount);
await t.scroll(Selector('html'), 0, 7000);
await t
.expect(async () => {
const newPostCount = await Selector('[data-testid="feed-post"]').count;
return newPostCount > initialPostCount;
})
.ok({ timeout: 5000 });
});

0 comments on commit 131135b

Please sign in to comment.