test: tighten block reply enqueue assertion · openclaw/openclaw@9b3c368
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -309,7 +309,15 @@ describe("createBlockReplyDeliveryHandler", () => {
|
309 | 309 | |
310 | 310 | await handler(payload); |
311 | 311 | |
312 | | -const enqueuedPayload = enqueue.mock.calls[0]?.[0]; |
| 312 | +expect(enqueue).toHaveBeenCalledTimes(1); |
| 313 | +const [firstCall] = enqueue.mock.calls; |
| 314 | +if (!firstCall) { |
| 315 | +throw new Error("Expected block reply pipeline enqueue call"); |
| 316 | +} |
| 317 | +const [enqueuedPayload] = firstCall; |
| 318 | +if (enqueuedPayload === undefined) { |
| 319 | +throw new Error("Expected block reply pipeline payload"); |
| 320 | +} |
313 | 321 | expect(enqueuedPayload).toEqual({ |
314 | 322 | text: "Alpha", |
315 | 323 | mediaUrl: undefined, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。