Tests: the start-up checks look at MCP's own notices (the suite shares one config directory)
ci / check (push) Canceled after 0s
ci / check (push) Canceled after 0s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
2 files changed
+6
-5
No files matched your search
@@ -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: ")
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user