test: tighten telegram group auth thread assertions

This commit is contained in:
Shakker
2026-05-11 03:36:21 +01:00
parent 429a6a8cc9
commit 5da9976321

View File

@@ -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 },
);
});
});