fix: Cataloging problem on /post #23
|
@ -26,10 +26,12 @@
|
||||||
<hr class="separator" />
|
<hr class="separator" />
|
||||||
<div id="page-navigator">
|
<div id="page-navigator">
|
||||||
<a
|
<a
|
||||||
|
aria-label="First Page"
|
||||||
class="nav-link icon"
|
class="nav-link icon"
|
||||||
class:disabled-link={disableLinkPrev}
|
class:disabled-link={disableLinkPrev}
|
||||||
href={firstPageLink}><DoubleArrowLeft /></a>
|
href={firstPageLink}><DoubleArrowLeft /></a>
|
||||||
<a
|
<a
|
||||||
|
aria-label="Prev Page"
|
||||||
class="nav-link icon"
|
class="nav-link icon"
|
||||||
class:disabled-link={disableLinkPrev}
|
class:disabled-link={disableLinkPrev}
|
||||||
href={prevLink}><ChevronLeft /></a>
|
href={prevLink}><ChevronLeft /></a>
|
||||||
|
@ -37,10 +39,12 @@
|
||||||
<p id="page-num">{pageN}/{maxPageN}</p>
|
<p id="page-num">{pageN}/{maxPageN}</p>
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
|
aria-label="Next Page"
|
||||||
class="nav-link icon"
|
class="nav-link icon"
|
||||||
class:disabled-link={disableLinkNext}
|
class:disabled-link={disableLinkNext}
|
||||||
href="/page/{Math.min(maxPageN, pageN+1)}"><ChevronRight /></a>
|
href="/page/{Math.min(maxPageN, pageN+1)}"><ChevronRight /></a>
|
||||||
<a
|
<a
|
||||||
|
aria-label="Last Page"
|
||||||
class="nav-link icon"
|
class="nav-link icon"
|
||||||
class:disabled-link={disableLinkNext}
|
class:disabled-link={disableLinkNext}
|
||||||
href="/page/{maxPageN}"><DoubleArrowRight /></a>
|
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 page.getByText('The Perfect Math Class').click();
|
||||||
await expect(page).toHaveURL("/post/the-perfect-math-class/");
|
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