mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
docs: point home modality chips at the sectioned tool pages (#485)
The tool reference moved to /tools/<section>/<toolId>, but the five modality chips on the docs home still linked to the old flat paths. A full page load survives via the Cloudflare _redirects shim, but VitePress client-side navigation bypasses it and lands on the 404 page. A dist-wide internal link check confirms these five were the only remaining stale links in the built site. The homepage e2e spec now pins all five chip hrefs and click-navigates one chip client-side, which is exactly the path that broke.
This commit is contained in:
@@ -43,6 +43,24 @@ test.describe("docs homepage (Two Doors)", () => {
|
||||
await expect(page.getByRole("link", { name: /Image/ })).toBeVisible();
|
||||
});
|
||||
|
||||
test("modality chips navigate to live tool pages client-side", async ({ page }) => {
|
||||
const chips = [
|
||||
{ label: /^Image/, href: "/tools/image/resize" },
|
||||
{ label: /^Video/, href: "/tools/video/convert-video" },
|
||||
{ label: /^Audio/, href: "/tools/audio/convert-audio" },
|
||||
{ label: /^PDF/, href: "/tools/pdf/merge-pdf" },
|
||||
{ label: /^Files/, href: "/tools/files/chart-maker" },
|
||||
];
|
||||
for (const chip of chips) {
|
||||
await expect(page.getByRole("link", { name: chip.label })).toHaveAttribute("href", chip.href);
|
||||
}
|
||||
// Click through one chip: SPA navigation bypasses the _redirects shim,
|
||||
// so a stale href 404s here even though a full page load would redirect.
|
||||
await page.getByRole("link", { name: /^Image/ }).click();
|
||||
await expect(page).toHaveURL(/\/tools\/image\/resize/);
|
||||
await expect(page.getByRole("heading", { level: 1, name: "Resize" })).toBeVisible();
|
||||
});
|
||||
|
||||
test("nav links work", async ({ page }) => {
|
||||
await expect(page.getByRole("link", { name: "Guide" }).first()).toBeVisible();
|
||||
await page.getByRole("link", { name: "Guide" }).first().click();
|
||||
|
||||
Reference in New Issue
Block a user