Skip to content

Commit a43ed39

Browse files
committed
test(tui): find the overlay select inside its ScrollBox
Choice names, empty descriptions, and stale-row replacement still assert painted behavior. The lookup was failing only because the select is no longer a direct child of the overlay body.
1 parent 96c0b6f commit a43ed39

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/tui/decision-truncation.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ const hintRequest: PermissionRequest = {
4141
function bodySelect(
4242
view: ReturnType<typeof createOverlayView>,
4343
): SelectRenderable {
44+
// The list lives in the host ScrollBox, not as a direct body child.
4445
const found = view.body
4546
.getChildren()
47+
.flatMap((row) =>
48+
row instanceof SelectRenderable ? [row] : row.getChildren(),
49+
)
4650
.find((row) => row instanceof SelectRenderable);
4751
if (!(found instanceof SelectRenderable))
4852
throw new Error("expected the overlay list");

‎src/tui/overlay-view.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ function bodyRows(view: ReturnType<typeof createOverlayView>): string[] {
3333
function bodySelect(
3434
view: ReturnType<typeof createOverlayView>,
3535
): SelectRenderable {
36+
// The list lives in the host ScrollBox, not as a direct body child.
3637
const found = view.body
3738
.getChildren()
39+
.flatMap((row) =>
40+
row instanceof SelectRenderable ? [row] : row.getChildren(),
41+
)
3842
.find((row) => row instanceof SelectRenderable);
3943
if (!(found instanceof SelectRenderable))
4044
throw new Error("expected the overlay list");

0 commit comments

Comments
 (0)