fix: Cataloging problem on /post #23
|
@ -26,10 +26,12 @@
|
|||
<hr class="separator" />
|
||||
<div id="page-navigator">
|
||||
<a
|
||||
aria-label="First Page"
|
||||
class="nav-link icon"
|
||||
class:disabled-link={disableLinkPrev}
|
||||
href={firstPageLink}><DoubleArrowLeft /></a>
|
||||
<a
|
||||
aria-label="Prev Page"
|
||||
class="nav-link icon"
|
||||
class:disabled-link={disableLinkPrev}
|
||||
href={prevLink}><ChevronLeft /></a>
|
||||
|
@ -37,10 +39,12 @@
|
|||
<p id="page-num">{pageN}/{maxPageN}</p>
|
||||
</div>
|
||||
<a
|
||||
aria-label="Next Page"
|
||||
class="nav-link icon"
|
||||
class:disabled-link={disableLinkNext}
|
||||
href="/page/{Math.min(maxPageN, pageN+1)}"><ChevronRight /></a>
|
||||
<a
|
||||
aria-label="Last Page"
|
||||
class="nav-link icon"
|
||||
class:disabled-link={disableLinkNext}
|
||||
href="/page/{maxPageN}"><DoubleArrowRight /></a>
|
||||
|
|
|
@ -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/");
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue