Skip to content

Commit 9454ea5

Browse files
committed
Harden landing notice gutter assert against cwd paths
Full-frame not.toContain("overlay") false-positives when the worktree path itself contains that substring in chrome. Assert on the flushed notice row model and painted notice lines instead.
1 parent fffb288 commit 9454ea5

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

src/tui/landing.test.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,10 +661,23 @@ describe("landing screen", () => {
661661
await settle(h);
662662

663663
expect(isLanding(shell)).toBe(false);
664-
const frame = h.captureCharFrame();
665-
expect(frame).toContain("mcp github did not connect");
666-
expect(frame).not.toContain("command");
667-
expect(frame).not.toContain("overlay");
664+
// Assert on the flushed notice row(s) — not the full char frame. The
665+
// footer/chrome can echo the process cwd, and a worktree path that
666+
// happens to contain "overlay" (or "command") must not false-positive
667+
// the plumbing-label invariant.
668+
const noticeNeedle = "mcp github did not connect";
669+
const noticeRows = shell.streamLog.filter((row) => row.text.includes(noticeNeedle));
670+
expect(noticeRows.length).toBeGreaterThan(0);
671+
for (const row of noticeRows) {
672+
expect(row.meta).not.toBe("command");
673+
expect(row.meta).not.toBe("overlay");
674+
}
675+
const painted = rows(h).filter((line) => line.includes(noticeNeedle));
676+
expect(painted.length).toBeGreaterThan(0);
677+
for (const line of painted) {
678+
expect(line).not.toContain("command");
679+
expect(line).not.toContain("overlay");
680+
}
668681
} finally {
669682
shell.dispose();
670683
}

0 commit comments

Comments
 (0)