diff --git a/src/auto-reply/reply/dispatch-from-config.test.ts b/src/auto-reply/reply/dispatch-from-config.test.ts index 7de5db59892..3f6c40acfa7 100644 --- a/src/auto-reply/reply/dispatch-from-config.test.ts +++ b/src/auto-reply/reply/dispatch-from-config.test.ts @@ -1358,11 +1358,13 @@ describe("dispatchReplyFromConfig", () => { opts?: GetReplyOptions, _cfg?: OpenClawConfig, ) => { - expect(requireToolResultHandler(opts?.onToolResult)).toEqual(expect.any(Function)); + const onToolResult = requireToolResultHandler(opts?.onToolResult); + await onToolResult({ text: "tool output" }); return { text: "hi" } satisfies ReplyPayload; }; await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver }); + expect(dispatcher.sendToolResult).toHaveBeenCalledWith({ text: "tool output" }); expect(dispatcher.sendFinalReply).toHaveBeenCalledTimes(1); }); diff --git a/src/commands/models/auth.test.ts b/src/commands/models/auth.test.ts index cb09062cced..1f1ac6f5f59 100644 --- a/src/commands/models/auth.test.ts +++ b/src/commands/models/auth.test.ts @@ -547,7 +547,8 @@ describe("modelsAuthLoginCommand", () => { expect(ctx.env).toBe(process.env); expect(ctx.allowSecretRefPrompt).toBe(false); expect(ctx.isRemote).toBe(false); - expect(ctx.openUrl).toEqual(expect.any(Function)); + await ctx.openUrl("https://example.com/auth"); + expect(mocks.openUrl).toHaveBeenCalledWith("https://example.com/auth"); expect(ctx.oauth).toMatchObject({ createVpsAwareHandlers: expect.any(Function), });