test: tighten acp session meta assertion · openclaw/openclaw@22ead00
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -41,29 +41,32 @@ describe("listAcpSessionEntries", () => {
|
41 | 41 | storePath: "/custom/sessions/ops.json", |
42 | 42 | }, |
43 | 43 | ]); |
44 | | -hoisted.loadSessionStoreMock.mockReturnValue({ |
45 | | -"agent:ops:acp:s1": { |
46 | | -updatedAt: 123, |
47 | | -acp: { |
48 | | -backend: "acpx", |
49 | | -agent: "ops", |
50 | | -mode: "persistent", |
51 | | -state: "idle", |
52 | | -}, |
| 44 | +const storedEntry = { |
| 45 | +updatedAt: 123, |
| 46 | +acp: { |
| 47 | +backend: "acpx", |
| 48 | +agent: "ops", |
| 49 | +mode: "persistent", |
| 50 | +state: "idle", |
53 | 51 | }, |
| 52 | +}; |
| 53 | +hoisted.loadSessionStoreMock.mockReturnValue({ |
| 54 | +"agent:ops:acp:s1": storedEntry, |
54 | 55 | }); |
55 | 56 | |
56 | 57 | const entries = await listAcpSessionEntries({ cfg }); |
57 | 58 | |
58 | 59 | expect(hoisted.resolveAllAgentSessionStoreTargetsMock).toHaveBeenCalledWith(cfg, undefined); |
59 | 60 | expect(hoisted.loadSessionStoreMock).toHaveBeenCalledWith("/custom/sessions/ops.json"); |
60 | 61 | expect(entries).toEqual([ |
61 | | -expect.objectContaining({ |
| 62 | +{ |
| 63 | +acp: storedEntry.acp, |
62 | 64 | cfg, |
| 65 | +entry: storedEntry, |
63 | 66 | storePath: "/custom/sessions/ops.json", |
64 | 67 | sessionKey: "agent:ops:acp:s1", |
65 | 68 | storeSessionKey: "agent:ops:acp:s1", |
66 | | -}), |
| 69 | +}, |
67 | 70 | ]); |
68 | 71 | }); |
69 | 72 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。