fix: prove resilient keyboard and no-script paths

This commit is contained in:
2026-09-02 03:25:22 +03:00
parent 091ff70deb
commit 829fed53aa
4 changed files with 244 additions and 2 deletions

View File

@@ -78,6 +78,25 @@ test('tabs from the skip link through navigation and every contact action', asyn
}
});
test('activating the skip link focuses the visible unobscured portfolio content', async ({
page,
distUrl,
}) => {
await page.goto(distUrl, { waitUntil: 'domcontentloaded' });
await page.keyboard.press('Tab');
await expect(page.locator('.skip-link')).toBeFocused();
await page.keyboard.press('Enter');
await expect(page).toHaveURL(`${distUrl}/#portfolio-content`);
await expect(page.locator('#portfolio-content')).toBeFocused();
await expect(page.locator('#portfolio-content')).toHaveAttribute(
'tabindex',
'-1',
);
await assertVisibleUnobscuredFocus(page);
});
test('explicit section activation scrolls to and focuses its heading', async ({
page,
distUrl,