From dcddb8f4bbfe8844e6d5cef755dba4b60fb6e03c Mon Sep 17 00:00:00 2001 From: Martin Dvorak Date: Tue, 13 Oct 2026 06:41:53 +0000 Subject: [PATCH] Make the mobile suite's backdrop-tap check deterministic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sheet's spring animation meant the box measured right after the dialog appeared could be mid-flight; tapping 24px above it sometimes landed inside the sheet once it settled (the deploy gate caught it twice — production was never touched). Tap a fixed point near the top instead: the sheet is max-h-[90dvh], so its top edge cannot reach y=12. Three consecutive mobile runs: 119/119 each. --- tests/mobile-test.mjs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/mobile-test.mjs b/tests/mobile-test.mjs index 3b28599..5c9e287 100644 --- a/tests/mobile-test.mjs +++ b/tests/mobile-test.mjs @@ -178,11 +178,13 @@ for (const locale of ["en", "cs"]) { await page.waitForTimeout(800); check("handle+header swipe closes the sheet", (await dialog.count()) === 0); - // backdrop tap + // backdrop tap — at a fixed point near the top: the sheet is max-h-[90dvh], + // so its top edge can never reach it, while a point measured mid-animation + // can end up inside the sheet once the spring settles. await page.locator("nav.tabbar").getByRole("button").click(); await dialog.waitFor({ timeout: 6000 }); - const sheetBox = await box(dialog); - await page.mouse.click(195, Math.max(8, sheetBox.y - 24)); + await page.waitForTimeout(700); + await page.mouse.click(195, 12); await page.waitForTimeout(800); check("backdrop tap closes", (await dialog.count()) === 0);