From c8c6e7e23f79d97a7a07f09ad9c3a5e7f2285b9e Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 23 Oct 2026 16:49:06 +0800 Subject: [PATCH] gui tests: modal-morph measures the provider row once the list is still Chromium at 420px read the row 1 to 5px off the strip the dialog grew from (401 vs 404-406), red 4 of 4 here on db48697d6 and on its parent: the list's rows were still coming in when the row was measured. The test now waits until the row's top is the same 100ms apart. Run: modal-morph.test.cjs chromium 3 of 3 green (was 0 of 4), webkit green. The app is unchanged. --- internal/gui/tests/modal-morph.test.cjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/gui/tests/modal-morph.test.cjs b/internal/gui/tests/modal-morph.test.cjs index ace80444e..8f893ed32 100644 --- a/internal/gui/tests/modal-morph.test.cjs +++ b/internal/gui/tests/modal-morph.test.cjs @@ -83,6 +83,15 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", await page.goto("http://magpie.test/?view=providers"); const row = page.locator('.row.provider[data-id="delta"]'); await row.waitFor(); + // the list still: at 420px its rows come in, a pixel or more each + // frame, and a row measured on the way read 1 to 5px off where the + // dialog then grew from (10-23) + await page.waitForFunction(() => { + const y = document.querySelector('.row.provider[data-id="delta"]').getBoundingClientRect().y; + const was = window.__rowY; + window.__rowY = y; + return was === y; + }, null, { polling: 100 }); await page.evaluate(() => { window.__hold = true; }); const r = await row.boundingBox();