A cap measured against the canvas needs a yardstick from the canvas, so the check stops carrying a number
game-maker / suite (push) Successful in 11m11s
game-maker / suite (push) Successful in 11m11s
The height cap used to be a constant 420, and the check wrote that number down. Since #43 the cap is the canvas minus a tenth at either end, which is 640 on an 800px screen - so CI failed on a picker that is behaving exactly as intended. The check now reads the budget off the screen and reports rect, budget and screen height when it trips, so the next change to the margin cannot strand it again.
This commit is contained in:
1 parent
3b039384c4
commit
30090fc48e
1 file changed
+7
-4
@@ -25,15 +25,18 @@ export async function menus(t) {
|
|||||||
await sleep(150);
|
await sleep(150);
|
||||||
|
|
||||||
// 11a. A picker with 40+ entries is capped in height and stays fully on screen instead of
|
// 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')");
|
const parentRow = await json("__gm.inspectorField('Parent')");
|
||||||
await click(parentRow.x, parentRow.y);
|
await click(parentRow.x, parentRow.y);
|
||||||
const rect = await json('__gm.overlayRect()');
|
const rect = await json('__gm.overlayRect()');
|
||||||
const screenHeight = await json('window.innerHeight');
|
const screenHeight = await json('window.innerHeight');
|
||||||
|
const budget = screenHeight - Math.round(screenHeight * 0.1) * 2;
|
||||||
check(
|
check(
|
||||||
'a long parent picker is capped instead of growing with the object count',
|
'a long parent picker is capped to the canvas budget instead of growing with the object count',
|
||||||
rect && rect.h < 420,
|
rect && rect.h <= budget,
|
||||||
JSON.stringify(rect),
|
JSON.stringify({ rect, budget, screenHeight }),
|
||||||
);
|
);
|
||||||
check(
|
check(
|
||||||
'the capped picker stays fully on screen',
|
'the capped picker stays fully on screen',
|
||||||
|
|||||||
Reference in new issue
Block a user