From 5da99763217aabeed4bf4887bb79dfe151b053dc Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 03:36:21 +0100 Subject: [PATCH] test: tighten telegram group auth thread assertions --- .../bot-native-commands.group-auth.test.ts | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/extensions/telegram/src/bot-native-commands.group-auth.test.ts b/extensions/telegram/src/bot-native-commands.group-auth.test.ts index 6451bedcadd..3fad3c55d44 100644 --- a/extensions/telegram/src/bot-native-commands.group-auth.test.ts +++ b/extensions/telegram/src/bot-native-commands.group-auth.test.ts @@ -108,7 +108,7 @@ describe("native command auth in groups", () => { expect(sendMessage).toHaveBeenCalledWith( -100999, "You are not authorized to use this command.", - expect.objectContaining({ message_thread_id: 42 }), + { message_thread_id: 42 }, ); }); @@ -138,11 +138,9 @@ describe("native command auth in groups", () => { await handlers.status?.(ctx); - expect(sendMessage).toHaveBeenCalledWith( - -100999, - "Telegram group commands are disabled.", - expect.objectContaining({ message_thread_id: 42 }), - ); + expect(sendMessage).toHaveBeenCalledWith(-100999, "Telegram group commands are disabled.", { + message_thread_id: 42, + }); }); it("keeps group chat allowlists enforced when commands.allowFrom is configured", async () => { @@ -166,11 +164,9 @@ describe("native command auth in groups", () => { await handlers.status?.(ctx); - expect(sendMessage).toHaveBeenCalledWith( - -100999, - "This group is not allowed.", - expect.objectContaining({ message_thread_id: 42 }), - ); + expect(sendMessage).toHaveBeenCalledWith(-100999, "This group is not allowed.", { + message_thread_id: 42, + }); }); it("rejects native commands in groups when sender is in neither allowlist", async () => { @@ -206,7 +202,7 @@ describe("native command auth in groups", () => { expect(sendMessage).toHaveBeenCalledWith( -100999, "You are not authorized to use this command.", - expect.objectContaining({ message_thread_id: 42 }), + { message_thread_id: 42 }, ); }); });