fix: Cataloging problem on /post #23

Merged
aniva merged 6 commits from post/page into main 2024-10-18 11:17:32 -07:00
2 changed files with 16 additions and 0 deletions
Showing only changes of commit 62485531e5 - Show all commits

View File

@ -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>

View File

@ -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/");
});