diff --git a/src/lib/components/PostList.svelte b/src/lib/components/PostList.svelte index d2de152..35d4b91 100644 --- a/src/lib/components/PostList.svelte +++ b/src/lib/components/PostList.svelte @@ -26,10 +26,12 @@
diff --git a/tests/post.spec.ts b/tests/post.spec.ts index bcd1052..fde2be8 100644 --- a/tests/post.spec.ts +++ b/tests/post.spec.ts @@ -5,3 +5,15 @@ test('Navigate to blog post', async ({ page }) => { await page.getByText('The Perfect Math Class').click(); await expect(page).toHaveURL("/post/the-perfect-math-class/"); }); + +test('Navigate to page 2', async ({ page }) => { + await page.goto('/post'); + await page.getByRole('link', { name: 'Next Page' }).click(); + await expect(page).toHaveURL("/page/2/"); + await page.getByRole('link', { name: 'Prev Page' }).click(); + await expect(page).toHaveURL("/post/"); + await page.getByRole('link', { name: 'Last Page' }).click(); + await expect(page).toHaveURL("/page/2/"); + await page.getByRole('link', { name: 'First Page' }).click(); + await expect(page).toHaveURL("/post/"); +});