test(telegram): cover per-account timeoutSeconds (#863)

Co-authored-by: Snaver <194855+Snaver@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-01-14 10:35:42 +00:00
parent 95bdb28a05
commit b7a11b7bd4
2 changed files with 38 additions and 0 deletions

View File

@@ -104,6 +104,23 @@ describe("sendMessageTelegram", () => {
}),
);
});
it("prefers per-account timeoutSeconds overrides", async () => {
loadConfig.mockReturnValue({
channels: {
telegram: {
timeoutSeconds: 60,
accounts: { foo: { timeoutSeconds: 61 } },
},
},
});
await sendMessageTelegram("123", "hi", { token: "tok", accountId: "foo" });
expect(botCtorSpy).toHaveBeenCalledWith(
"tok",
expect.objectContaining({
client: expect.objectContaining({ timeoutSeconds: 61 }),
}),
);
});
it("falls back to plain text when Telegram rejects HTML", async () => {
const chatId = "123";