mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-18 12:08:52 +00:00
test: tighten telegram group auth thread assertions
This commit is contained in:
@@ -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 },
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user