fix: close final portfolio quality gaps
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
import { expect, test } from "../helpers/serve-dist";
|
||||
import {
|
||||
clickNavigationLink,
|
||||
expect,
|
||||
revealNavigationLinks,
|
||||
test,
|
||||
} from "../helpers/serve-dist";
|
||||
|
||||
test("keeps canonical hrefs while creating exactly one or zero explicit history entries", async ({
|
||||
page,
|
||||
@@ -6,20 +11,18 @@ test("keeps canonical hrefs while creating exactly one or zero explicit history
|
||||
}) => {
|
||||
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
|
||||
const initialLength = await page.evaluate(() => history.length);
|
||||
const start = page.locator('nav a[href="#start"]');
|
||||
const profile = page.locator('nav a[href="#profile"]');
|
||||
|
||||
await start.click();
|
||||
await clickNavigationLink(page, "#start");
|
||||
await expect(page).toHaveURL(`${distUrl}/`);
|
||||
expect(await page.evaluate(() => history.length)).toBe(initialLength);
|
||||
await expect(page.locator("#start-heading")).toBeFocused();
|
||||
|
||||
await profile.click();
|
||||
await clickNavigationLink(page, "#profile");
|
||||
await expect(page).toHaveURL(`${distUrl}/#profile`);
|
||||
expect(await page.evaluate(() => history.length)).toBe(initialLength + 1);
|
||||
await expect(page.locator("#profile-heading")).toBeFocused();
|
||||
|
||||
await profile.click();
|
||||
await clickNavigationLink(page, "#profile");
|
||||
expect(await page.evaluate(() => history.length)).toBe(initialLength + 1);
|
||||
await expect(page.locator("#profile-heading")).toBeFocused();
|
||||
});
|
||||
@@ -27,7 +30,11 @@ test("keeps canonical hrefs while creating exactly one or zero explicit history
|
||||
test("cancels pending explicit focus when wheel intent intervenes", async ({
|
||||
page,
|
||||
distUrl,
|
||||
}) => {
|
||||
}, testInfo) => {
|
||||
test.skip(
|
||||
testInfo.project.name === "mobile-chromium",
|
||||
"Hidden-focus cancellation is covered once in desktop Chromium.",
|
||||
);
|
||||
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
|
||||
const link = page.locator('nav a[href="#infrastructure"]');
|
||||
await link.focus();
|
||||
@@ -56,6 +63,7 @@ test("passive scrolling replaces a stable fragment without stealing focus", asyn
|
||||
distUrl,
|
||||
}) => {
|
||||
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
|
||||
await revealNavigationLinks(page);
|
||||
const link = page.locator('nav a[href="#start"]');
|
||||
await link.focus();
|
||||
|
||||
@@ -80,8 +88,8 @@ test("back and forward restore sections without another history mutation or focu
|
||||
distUrl,
|
||||
}) => {
|
||||
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
|
||||
await page.locator('nav a[href="#profile"]').click();
|
||||
await page.locator('nav a[href="#experience"]').click();
|
||||
await clickNavigationLink(page, "#profile");
|
||||
await clickNavigationLink(page, "#experience");
|
||||
const historyLength = await page.evaluate(() => history.length);
|
||||
await expect(page.locator("#experience-heading")).toBeFocused();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user