mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 12:00:46 +00:00
test: tighten block reply enqueue assertion
This commit is contained in:
@@ -309,7 +309,15 @@ describe("createBlockReplyDeliveryHandler", () => {
|
||||
|
||||
await handler(payload);
|
||||
|
||||
const enqueuedPayload = enqueue.mock.calls[0]?.[0];
|
||||
expect(enqueue).toHaveBeenCalledTimes(1);
|
||||
const [firstCall] = enqueue.mock.calls;
|
||||
if (!firstCall) {
|
||||
throw new Error("Expected block reply pipeline enqueue call");
|
||||
}
|
||||
const [enqueuedPayload] = firstCall;
|
||||
if (enqueuedPayload === undefined) {
|
||||
throw new Error("Expected block reply pipeline payload");
|
||||
}
|
||||
expect(enqueuedPayload).toEqual({
|
||||
text: "Alpha",
|
||||
mediaUrl: undefined,
|
||||
|
||||
Reference in New Issue
Block a user