test(tts): add test for missing channel fail-fast

Covers the new no_channel early return when TTS tool is called 
without a bound delivery channel.

Part of #43483
This commit is contained in:
Hiago Silva 2026-03-16 08:47:37 -03:00 committed by GitHub
parent fdc003bb3f
commit 014fc66da1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,8 +9,14 @@ const { createTtsTool } = await import("./tts-tool.js");
describe("createTtsTool", () => {
it("uses SILENT_REPLY_TOKEN in guidance text", () => {
const tool = createTtsTool();
expect(tool.description).toContain("QUIET_TOKEN");
expect(tool.description).not.toContain("NO_REPLY");
});
it("returns error when no delivery channel is available", async () => {
const tool = createTtsTool();
const result = await tool.execute("test-call", { text: "hello world" });
expect(result.content[0].text).toContain("requires a bound channel");
expect(result.details.error).toBe("no_channel");
});
});