test: approve automated portfolio visual quality
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user