diff --git a/src/tools/send.test.ts b/src/tools/send.test.ts index 5cb64e4..e4d91dd 100644 --- a/src/tools/send.test.ts +++ b/src/tools/send.test.ts @@ -99,4 +99,13 @@ describe("send tool", () => { await expect(handleSend({ path: "big.bin" }, opts)).rejects.toThrow(/document too large: 51\.0 MB > 50 MB/); expect(bot.sendDocument).not.toHaveBeenCalled(); }); + + it("exposes a Pi tool that returns text content", async () => { + await writeFile(path.join(dir, "hello.png"), Buffer.from("fake-png")); + const tool = createSendTool(opts); + expect(tool.name).toBe("send"); + const result = await tool.execute("call-1", { path: "hello.png" }, undefined, undefined, undefined as never); + expect(result.content).toEqual([{ type: "text", text: "Sent hello.png as photo." }]); + expect(bot.sendPhoto).toHaveBeenCalledTimes(1); + }); });