From 0614a3f55fe4692799bbb47ad5aca4bec201f330 Mon Sep 17 00:00:00 2001 From: Shakker Date: Sun, 10 May 2026 16:45:30 +0100 Subject: [PATCH] test: clear clickclack broad matchers --- extensions/clickclack/src/inbound.test.ts | 29 ++++++++++------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/extensions/clickclack/src/inbound.test.ts b/extensions/clickclack/src/inbound.test.ts index 306b126ed2b..472e95ce576 100644 --- a/extensions/clickclack/src/inbound.test.ts +++ b/extensions/clickclack/src/inbound.test.ts @@ -115,22 +115,17 @@ describe("handleClickClackInbound", () => { expect(runtime.channel.turn.runPrepared).not.toHaveBeenCalled(); expect(runtime.agent.runEmbeddedPiAgent).not.toHaveBeenCalled(); - expect(runtime.llm.complete).toHaveBeenCalledWith( - expect.objectContaining({ - agentId: "service-bot", - model: "openai/gpt-5.4-mini", - maxTokens: 96, - purpose: "clickclack bot reply", - messages: [{ role: "user", content: "hello bot" }], - }), - ); - expect(sendClickClackTextMock).toHaveBeenCalledWith( - expect.objectContaining({ - accountId: "service", - to: "channel:chn_1", - text: "service bot online", - replyToId: "msg_1", - }), - ); + const completionRequest = runtime.llm.complete.mock.calls[0]?.[0]; + expect(completionRequest?.agentId).toBe("service-bot"); + expect(completionRequest?.model).toBe("openai/gpt-5.4-mini"); + expect(completionRequest?.maxTokens).toBe(96); + expect(completionRequest?.purpose).toBe("clickclack bot reply"); + expect(completionRequest?.messages).toEqual([{ role: "user", content: "hello bot" }]); + + const sendRequest = sendClickClackTextMock.mock.calls[0]?.[0]; + expect(sendRequest?.accountId).toBe("service"); + expect(sendRequest?.to).toBe("channel:chn_1"); + expect(sendRequest?.text).toBe("service bot online"); + expect(sendRequest?.replyToId).toBe("msg_1"); }); });