From 739cb6e6e2894e5626c32100c2c6a6d22b122615 Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Sun, 28 Jun 2026 13:09:40 -0500 Subject: [PATCH] test: wait for contact linework before measuring The mobile contact linework is loading=lazy and only resolved when scrolled into view. Wait for it to finish loading before the geometry assertions read its bounding rect, matching the pattern already used for the Our Work desktop vector. --- tests/mobile-homepage.spec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/mobile-homepage.spec.js b/tests/mobile-homepage.spec.js index a18fc36..22a5f92 100644 --- a/tests/mobile-homepage.spec.js +++ b/tests/mobile-homepage.spec.js @@ -352,6 +352,19 @@ test("mobile contact card matches the 402px reference geometry", async ({ const linework = await getBox( cardLocator.locator(".contact-block__linework--mobile"), ); + await cardLocator + .locator(".contact-block__linework--mobile") + .evaluate( + (image) => + /** @type {HTMLImageElement} */ (image).complete || + new Promise((resolve) => { + /** @type {HTMLImageElement} */ (image).addEventListener( + "load", + () => resolve(undefined), + { once: true }, + ); + }), + ); const backgroundImage = cardLocator.locator(".contact-block__bg-image"); const bandHeight = await cardLocator.evaluate((element) => Number.parseFloat(getComputedStyle(element).borderBottomWidth),