A step opens a tab the way a person has to, through the menu when it is hidden

CI run 35 was red: the suite died after step 15 with `widget with text
"Container" not found`. Nothing in the editor broke — the tenth tab (#73) pushed
Container behind the `»` button at the test window's 1280 px, exactly the case
#84 was built for, and three steps still clicked the tab name directly.

openTab(t, tab) in tools/e2e/lib/scaffold.mjs asks tabRow() whether the tab is
hidden and goes through the menu when it is, so the fix lives in one place rather
than in every step that opens a tab. The LABELS record moves there as TAB_LABELS,
since both the helper and 14-overflow need it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rootandClaude Opus 5 committed 2026-09-14 07:03:40 +02:00
1 parent 0f9e1611d1
commit 4feb4c2cf6
5 files changed
+43 -24

No files matched your search

+5 -17
View File
@@ -1,3 +1,5 @@
import { TAB_LABELS } from './lib/scaffold.mjs';
/**
* Labels must be shortened to fit their control, not written past it. Runs last because it renames
* assets to absurd lengths to provoke the case.
@@ -6,20 +8,6 @@
/** A name far wider than any 200 px picker, so a control that does not truncate must spill. */
const LONG_NAME = 'Player movement with jumping and coyote time';
/** What the tab buttons read, to find one in the overflow menu. */
const LABELS = {
scene: 'Scene',
game: 'Game',
graph: 'Behavior',
statemachine: 'State machine',
shader: 'Shader',
texture: 'Texture',
animation: 'Animation',
container: 'Container',
list: 'List',
particles: 'Particles',
};
export async function overflow(t) {
const { check, sleep, json, evaluate, shot, mutate, drag, clickText } = t;
@@ -105,14 +93,14 @@ export async function overflow(t) {
const offered = await json('__gm.overlayTexts()');
check(
'the overflow button offers every tab that had to go',
narrow.hidden.every((tab) => offered.includes(LABELS[tab])),
narrow.hidden.every((tab) => offered.includes(TAB_LABELS[tab])),
JSON.stringify({ offered, hidden: narrow.hidden }),
);
await clickText(LABELS[wanted]);
await clickText(TAB_LABELS[wanted]);
await sleep(400);
const picked = await json('__gm.tabRow()');
check(
`picking ${LABELS[wanted]} from the overflow menu opens it and puts it in the row`,
`picking ${TAB_LABELS[wanted]} from the overflow menu opens it and puts it in the row`,
(await json('__gm.tab()')) === wanted && picked.shown.some((b) => b.tab === wanted),
JSON.stringify({ tab: await json('__gm.tab()'), shown: picked.shown.map((b) => b.tab) }),
);