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

@@ -211,6 +211,27 @@ describe("createTelegramBot", () => {
}),
);
});
it("prefers per-account timeoutSeconds overrides", () => {
loadConfig.mockReturnValue({
channels: {
telegram: {
dmPolicy: "open",
allowFrom: ["*"],
timeoutSeconds: 60,
accounts: {
foo: { timeoutSeconds: 61 },
},
},
},
});
createTelegramBot({ token: "tok", accountId: "foo" });
expect(botCtorSpy).toHaveBeenCalledWith(
"tok",
expect.objectContaining({
client: expect.objectContaining({ timeoutSeconds: 61 }),
}),
);
});
it("sequentializes updates by chat and thread", () => {
createTelegramBot({ token: "tok" });
expect(sequentializeSpy).toHaveBeenCalledTimes(1);