diff --git a/tools/e2e/11-menus.mjs b/tools/e2e/11-menus.mjs index 3f33c2a4..06dc2448 100644 --- a/tools/e2e/11-menus.mjs +++ b/tools/e2e/11-menus.mjs @@ -25,15 +25,18 @@ export async function menus(t) { await sleep(150); // 11a. A picker with 40+ entries is capped in height and stays fully on screen instead of - // running off the bottom edge. + // running off the bottom edge. The cap is a share of the canvas, not a constant: a tenth is + // left free at either end, so the number to beat is read off the screen rather than written + // down here – 40 rows would be well over a thousand pixels without it. const parentRow = await json("__gm.inspectorField('Parent')"); await click(parentRow.x, parentRow.y); const rect = await json('__gm.overlayRect()'); const screenHeight = await json('window.innerHeight'); + const budget = screenHeight - Math.round(screenHeight * 0.1) * 2; check( - 'a long parent picker is capped instead of growing with the object count', - rect && rect.h < 420, - JSON.stringify(rect), + 'a long parent picker is capped to the canvas budget instead of growing with the object count', + rect && rect.h <= budget, + JSON.stringify({ rect, budget, screenHeight }), ); check( 'the capped picker stays fully on screen',