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),