test: clarify memory and slack assertions · openclaw/openclaw@9905f2d
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -377,10 +377,14 @@ describe("memory index", () => {
|
377 | 377 | expect(embedBatchInputCalls).toBeGreaterThan(0); |
378 | 378 | |
379 | 379 | const imageResults = await manager.search("image"); |
380 | | -expect(imageResults.some((result) => result.path.endsWith("diagram.png"))).toBe(true); |
| 380 | +expect(imageResults.map((result) => result.path)).toContainEqual( |
| 381 | +expect.stringMatching(/diagram\.png$/), |
| 382 | +); |
381 | 383 | |
382 | 384 | const audioResults = await manager.search("audio"); |
383 | | -expect(audioResults.some((result) => result.path.endsWith("meeting.wav"))).toBe(true); |
| 385 | +expect(audioResults.map((result) => result.path)).toContainEqual( |
| 386 | +expect.stringMatching(/meeting\.wav$/), |
| 387 | +); |
384 | 388 | }); |
385 | 389 | |
386 | 390 | it("finds keyword matches via hybrid search when query embedding is zero", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -290,7 +290,7 @@ describe("handleSlackAction", () => {
|
290 | 290 | text: expect.stringContaining("/tmp/openclaw-media/report.pdf"), |
291 | 291 | }), |
292 | 292 | ); |
293 | | -expect(result.content.some((entry) => entry.type === "image")).toBe(false); |
| 293 | +expect(result.content.filter((entry) => entry.type === "image")).toEqual([]); |
294 | 294 | expect(result.details).toEqual( |
295 | 295 | expect.objectContaining({ |
296 | 296 | ok: true, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -93,7 +93,7 @@ describe("Slack directory contract", () => {
|
93 | 93 | limit: 2, |
94 | 94 | }); |
95 | 95 | expect(peers).toHaveLength(2); |
96 | | -expect(peers.every((entry) => entry.id.startsWith("user:u"))).toBe(true); |
| 96 | +expect(peers.filter((entry) => !entry.id.startsWith("user:u"))).toEqual([]); |
97 | 97 | }); |
98 | 98 | |
99 | 99 | it("resolves current Slack account identity from live auth", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。