fix: keep navigation labels single and accessible
This commit is contained in:
@@ -194,16 +194,15 @@ test("responsive navigation exposes the exact visible label as each link's acces
|
||||
await page.setViewportSize({ width: 1440, height: 900 });
|
||||
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
|
||||
|
||||
await expect(page.getByRole("link", { name: "Experience", exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: "Additional work", exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: "Career", exact: true })).toHaveCount(0);
|
||||
await expect(page.getByRole("link", { name: "More work", exact: true })).toHaveCount(0);
|
||||
await expect(page.getByRole("link", { name: "Career", exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: "More work", exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: "Experience", exact: true })).toHaveCount(0);
|
||||
await expect(page.getByRole("link", { name: "Additional work", exact: true })).toHaveCount(0);
|
||||
|
||||
await page.setViewportSize({ width: 320, height: 800 });
|
||||
const career = page.getByRole("link", { name: "Career", exact: true });
|
||||
const moreWork = page.getByRole("link", { name: "More work", exact: true });
|
||||
await expect(career.locator(".site-navigation__compact-label")).toHaveText("Career");
|
||||
await expect(moreWork.locator(".site-navigation__compact-label")).toHaveText("More work");
|
||||
await expect(career).toHaveText("Career");
|
||||
await expect(page.getByRole("link", { name: "More work", exact: true })).toHaveText("More work");
|
||||
await expect(page.getByRole("link", { name: "Experience", exact: true })).toHaveCount(0);
|
||||
await expect(page.getByRole("link", { name: "Additional work", exact: true })).toHaveCount(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user