test(telegram): cover threaded qa replies

This commit is contained in:
Ayaan Zaidi
2026-04-10 18:07:44 +05:30
parent 88a7970f84
commit 7348c3193d
2 changed files with 4 additions and 1 deletions

View File

@@ -73,6 +73,7 @@ describe("telegram live qa runtime", () => {
enabled: true,
botToken: "sut-token",
dmPolicy: "disabled",
replyToMode: "first",
groups: {
"-100123": {
groupPolicy: "allowlist",

View File

@@ -2388,6 +2388,7 @@ describe("createTelegramBot", () => {
});
it("threads native command replies inside topics", async () => {
commandSpy.mockClear();
sendMessageSpy.mockClear();
replySpy.mockResolvedValue({ text: "response" });
loadConfig.mockReturnValue({
@@ -2396,6 +2397,7 @@ describe("createTelegramBot", () => {
telegram: {
dmPolicy: "open",
allowFrom: ["*"],
replyToMode: "first",
groups: { "*": { requireMention: false } },
},
},
@@ -2413,7 +2415,7 @@ describe("createTelegramBot", () => {
expect(sendMessageSpy).toHaveBeenCalledWith(
"-1001234567890",
expect.any(String),
expect.objectContaining({ message_thread_id: 99 }),
expect.objectContaining({ message_thread_id: 99, reply_to_message_id: 42 }),
);
});
it("reloads native command routing bindings between invocations without recreating the bot", async () => {