import { parseClient } from "./clientScope"; test("one address passes, and nothing else does", () => { expect(parseClient("192.0.2.30")).toBe("192.0.2.30"); expect(parseClient("2001:db8::1")).toBe("2001:db8::1"); expect(parseClient(undefined)).toBeUndefined(); expect(parseClient("")).toBeUndefined(); expect(parseClient(7)).toBeUndefined(); // A list is the Activity filter's grammar, not this page's. expect(parseClient("192.0.2.30,192.0.2.31")).toBeUndefined(); // Longer than any address the server stores. expect(parseClient("1".repeat(46))).toBeUndefined(); expect(parseClient("1".repeat(45))).toBe("1".repeat(45)); });