test: clarify tui list assertions · openclaw/openclaw@f9812e6
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -60,7 +60,7 @@ describe("SearchableSelectList", () => {
|
60 | 60 | function expectNoMatchesForQuery(list: SearchableSelectList, query: string) { |
61 | 61 | typeInput(list, query); |
62 | 62 | const output = list.render(80); |
63 | | -expect(output.some((line) => line.includes("No matches"))).toBe(true); |
| 63 | +expect(output).toEqual(expect.arrayContaining([expect.stringContaining("No matches")])); |
64 | 64 | } |
65 | 65 | |
66 | 66 | function expectDescriptionVisibilityAtWidth(width: number, shouldContainDescription: boolean) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -179,7 +179,7 @@ describe("tui command handlers", () => {
|
179 | 179 | expect(setActivityStatus).toHaveBeenCalledWith("sending"); |
180 | 180 | const sendingOrder = setActivityStatus.mock.invocationCallOrder[0] ?? 0; |
181 | 181 | const renderOrders = requestRender.mock.invocationCallOrder; |
182 | | -expect(renderOrders.some((order) => order > sendingOrder)).toBe(true); |
| 182 | +expect(renderOrders.filter((order) => order > sendingOrder)).not.toEqual([]); |
183 | 183 | |
184 | 184 | resolveSend({ runId: "r1" }); |
185 | 185 | await pending; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -71,13 +71,14 @@ describe("tui slash commands", () => {
|
71 | 71 | |
72 | 72 | it("includes gateway text commands", () => { |
73 | 73 | const commands = getSlashCommands({}); |
74 | | -expect(commands.some((command) => command.name === "context")).toBe(true); |
75 | | -expect(commands.some((command) => command.name === "commands")).toBe(true); |
| 74 | +expect(commands.map((command) => command.name)).toEqual( |
| 75 | +expect.arrayContaining(["context", "commands"]), |
| 76 | +); |
76 | 77 | }); |
77 | 78 | |
78 | 79 | it("includes /auth in local embedded mode", () => { |
79 | 80 | const commands = getSlashCommands({ local: true }); |
80 | | -expect(commands.some((command) => command.name === "auth")).toBe(true); |
| 81 | +expect(commands.map((command) => command.name)).toContain("auth"); |
81 | 82 | }); |
82 | 83 | }); |
83 | 84 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。