fix: enforce first-frame timeout and nav labels

This commit is contained in:
2026-09-02 08:22:40 +03:00
parent 5edddb8781
commit 1734003172
10 changed files with 217 additions and 40 deletions

View File

@@ -186,3 +186,28 @@ test("explicit keyboard navigation focuses a section heading without a fixed-sur
expect(geometry.insideSafeBounds).toBe(true);
expect(geometry.overlapArea).toBe(0);
});
test("responsive navigation exposes the exact visible label as each link's accessible name", async ({
page,
distUrl,
}) => {
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 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(page.getByRole("link", { name: "Experience", exact: true })).toHaveCount(0);
await expect(page.getByRole("link", { name: "Additional work", exact: true })).toHaveCount(0);
await career.focus();
await page.keyboard.press("Enter");
await expect(page.locator("#experience-heading")).toBeFocused();
});

View File

@@ -94,6 +94,11 @@ test.describe('scene failure matrix', () => {
await expect(page.locator('.journey-world')).toHaveAttribute('data-static-fallback', 'true');
await expect(page.locator('.journey-canvas')).toHaveCount(0);
await assertSemanticFaultOracle(page);
const fault = await readFaultSnapshot(page);
expect(fault.events).toContain('first-frame-suppressed');
expect(fault.events).not.toContain('first-frame-deadline');
expect(fault.staticFallbackCount).toBe(1);
expect((await readSceneInstrumentation(page)).activeAnimationFrames).toBe(0);
await assertNoEscapedErrors(page, errors.pageErrors);
});