test: tighten nodes video assertions · openclaw/openclaw@0e1e485
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -151,15 +151,15 @@ describe("createNodesTool screen_record duration guardrails", () => {
|
151 | 151 | durationMs: 900_000, |
152 | 152 | }); |
153 | 153 | |
154 | | -expect(gatewayMocks.callGatewayTool).toHaveBeenCalledWith( |
155 | | - "node.invoke", |
156 | | -{}, |
157 | | -expect.objectContaining({ |
158 | | - params: expect.objectContaining({ |
159 | | - durationMs: 300_000, |
160 | | - }), |
161 | | - }), |
162 | | -); |
| 154 | +expect(gatewayMocks.callGatewayTool).toHaveBeenCalledTimes(1); |
| 155 | +const call = gatewayMocks.callGatewayTool.mock.calls[0] as [ |
| 156 | +string, |
| 157 | +unknown, |
| 158 | +{ params?: { durationMs?: unknown } }, |
| 159 | +]; |
| 160 | +expect(call[0]).toBe("node.invoke"); |
| 161 | +expect(call[1]).toStrictEqual({}); |
| 162 | +expect(call[2].params?.durationMs).toBe(300_000); |
163 | 163 | }); |
164 | 164 | |
165 | 165 | it("rejects the removed run action", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -54,11 +54,9 @@ describe("video generate background helpers", () => {
|
54 | 54 | providerId: "openai", |
55 | 55 | }); |
56 | 56 | |
57 | | -expect(handle).toMatchObject({ |
58 | | -taskId: "task-123", |
59 | | -requesterSessionKey: "agent:main:discord:direct:123", |
60 | | -taskLabel: "friendly lobster surfing", |
61 | | -}); |
| 57 | +expect(handle?.taskId).toBe("task-123"); |
| 58 | +expect(handle?.requesterSessionKey).toBe("agent:main:discord:direct:123"); |
| 59 | +expect(handle?.taskLabel).toBe("friendly lobster surfing"); |
62 | 60 | expectQueuedTaskRun({ |
63 | 61 | taskExecutorMocks, |
64 | 62 | taskKind: VIDEO_GENERATION_TASK_KIND, |
@@ -100,9 +98,7 @@ describe("video generate background helpers", () => {
|
100 | 98 | } |
101 | 99 | |
102 | 100 | expect(handle.runId).toMatch(/^tool:video_generate:/); |
103 | | -expect(getAgentRunContext(handle.runId)).toMatchObject({ |
104 | | -sessionKey: "agent:main:discord:channel:123", |
105 | | -}); |
| 101 | +expect(getAgentRunContext(handle.runId)?.sessionKey).toBe("agent:main:discord:channel:123"); |
106 | 102 | |
107 | 103 | const beforeProgress = Date.now(); |
108 | 104 | recordVideoGenerationTaskProgress({ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。