test: approve automated portfolio visual quality

This commit is contained in:
2026-09-02 08:03:41 +03:00
parent f4cf9fc77e
commit a1520f2783
7 changed files with 815 additions and 20 deletions

View File

@@ -63,7 +63,11 @@ test("passive scrolling replaces a stable fragment without stealing focus", asyn
window.dispatchEvent(new WheelEvent("wheel", { deltaY: 20 }));
const heading = document.querySelector<HTMLElement>("#experience-heading");
if (heading === null) throw new Error("Missing experience heading");
window.scrollTo(0, heading.offsetTop - window.innerHeight * 0.35);
const headingDocumentTop =
heading.getBoundingClientRect().top + window.scrollY;
// Place the heading just beyond the 35% activation line. Scroll offsets
// are integer-rounded in Chromium, so exact boundary equality is brittle.
window.scrollTo(0, headingDocumentTop - window.innerHeight * 0.34);
});
await expect(page).toHaveURL(`${distUrl}/#experience`, { timeout: 2000 });