From 98aa346c34543e85f3a6dce63a580372e4a078c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Bene=C5=A1?= Date: Thu, 12 Nov 2026 17:36:29 +0000 Subject: [PATCH] Tests: the start-up checks look at MCP's own notices (the suite shares one config directory) Co-Authored-By: Claude Fable 5.2 --- tests/tui/mcp.test.tsx | 10 ++++++---- tests/tui/menus.test.tsx | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/tui/mcp.test.tsx b/tests/tui/mcp.test.tsx index 5702880..b238610 100644 --- a/tests/tui/mcp.test.tsx +++ b/tests/tui/mcp.test.tsx @@ -17,10 +17,12 @@ test("a server that connects says nothing at start: no warning sign, no block await t.app.mcpReady await t.settle(200) const f = t.frame() - expect(f).not.toContain(NOTICES.warn.glyph) - expect(f).not.toContain("connected") + // (Other notices may be there — the whole suite shares one config directory — but none of MCP.) + const said = t.view.state.items.filter((i) => i.kind === "notice").map((i) => (i as { text: string }).text) + expect(said.filter((x) => /MCP|mcp__|connected/.test(x))).toEqual([]) + expect(f).not.toContain(`${NOTICES.warn.glyph} MCP`) + expect(f).not.toContain("connected —") expect(f).not.toContain("mcp__") - expect(t.view.state.items.filter((i) => i.kind === "notice")).toEqual([]) expect(f.split("\n").at(-2)).toContain("MCP 1 · ") }) @@ -28,7 +30,7 @@ test("a server that fails gets one plain line naming it and /mcp; the status bar t = await tui([], { width: 140, height: 30 }, `mcp:\n${local("fix")}${broken("gone")}`) await t.app.mcpReady await t.settle(300) - const notices = t.view.state.items.filter((i) => i.kind === "notice") as { text: string; level: string }[] + const notices = (t.view.state.items.filter((i) => i.kind === "notice") as { text: string; level: string }[]).filter((n) => n.text.startsWith("MCP ")) expect(notices.length).toBe(1) expect(notices[0]!.level).toBe("warn") expect(notices[0]!.text).toStartWith("MCP gone did not connect: ") diff --git a/tests/tui/menus.test.tsx b/tests/tui/menus.test.tsx index 558855b..86824cf 100644 --- a/tests/tui/menus.test.tsx +++ b/tests/tui/menus.test.tsx @@ -23,7 +23,6 @@ test("/help is a menu: commands under headings, found by typing; enter runs one, expect(f).toContain("This session") expect(f).toContain("/new") expect(f).toContain("type to find") - expect(f).not.toContain("⚠") // Typing finds a command by what it does, not only by its name. for (const ch of "permission rules") t.input.pressKey(ch) await t.settle()