Download extensions/googlechat/src/monitor.test.ts from quinnz/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 772 Bytes
-
https://huggingface.co/spaces/quinnz/openclaw/resolve/main/extensions/googlechat/src/monitor.test.ts
- Command line
-
hf download hf://spaces/quinnz/openclaw/extensions/googlechat/src/monitor.test.ts
-
curl -L -o monitor.test.ts https://huggingface.co/spaces/quinnz/openclaw/resolve/main/extensions/googlechat/src/monitor.test.ts
772 Bytes
| import { describe, expect, it } from "vitest"; | |
| import { isSenderAllowed } from "./monitor.js"; | |
| describe("isSenderAllowed", () => { | |
| it("matches allowlist entries with users/<email>", () => { | |
| expect(isSenderAllowed("users/123", "Jane@Example.com", ["users/jane@example.com"])).toBe(true); | |
| }); | |
| it("matches allowlist entries with raw email", () => { | |
| expect(isSenderAllowed("users/123", "Jane@Example.com", ["jane@example.com"])).toBe(true); | |
| }); | |
| it("still matches user id entries", () => { | |
| expect(isSenderAllowed("users/abc", "jane@example.com", ["users/abc"])).toBe(true); | |
| }); | |
| it("rejects non-matching emails", () => { | |
| expect(isSenderAllowed("users/123", "jane@example.com", ["users/other@example.com"])).toBe( | |
| false, | |
| ); | |
| }); | |
| }); | |