test: cover channel arg bypass scenario

This commit is contained in:
Hiago Silva 2026-03-16 09:49:15 -03:00 committed by GitHub
parent 646e1e41dc
commit 5f96aab719
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,11 +13,11 @@ describe("createTtsTool", () => {
expect(tool.description).not.toContain("NO_REPLY");
});
it("returns error when no delivery channel is available", async () => {
it("returns error even when channel arg is provided but no agentChannel", async () => {
const tool = createTtsTool();
const result = await tool.execute("test-call", { text: "hello world" });
const result = await tool.execute("test-call", { text: "hello world", channel: "telegram" });
const firstContent = result.content[0] as { type: string; text: string };
expect(firstContent.text).toContain("requires a bound channel");
expect(firstContent.text).toContain("requires a bound");
expect((result.details as Record<string, unknown>).error).toBe("no_channel");
});
});