mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
test(telegram): cover sender-only groupAllowFrom normalization
This commit is contained in:
@@ -2,14 +2,14 @@ import { describe, expect, it } from "vitest";
|
||||
import { normalizeAllowFrom } from "./bot-access.js";
|
||||
|
||||
describe("normalizeAllowFrom", () => {
|
||||
it("accepts signed numeric Telegram IDs and rejects usernames", () => {
|
||||
it("accepts sender IDs and keeps negative chat IDs invalid", () => {
|
||||
const result = normalizeAllowFrom(["-1001234567890", " tg:-100999 ", "745123456", "@someone"]);
|
||||
|
||||
expect(result).toEqual({
|
||||
entries: ["-1001234567890", "-100999", "745123456"],
|
||||
entries: ["745123456"],
|
||||
hasWildcard: false,
|
||||
hasEntries: true,
|
||||
invalidEntries: ["@someone"],
|
||||
invalidEntries: ["-1001234567890", "-100999", "@someone"],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user