Verified: - pnpm build - pnpm check - pnpm test Co-authored-by: xzq-xu <53989315+xzq-xu@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
17 lines
492 B
TypeScript
17 lines
492 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveReceiveIdType } from "./targets.js";
|
|
|
|
describe("resolveReceiveIdType", () => {
|
|
it("resolves chat IDs by oc_ prefix", () => {
|
|
expect(resolveReceiveIdType("oc_123")).toBe("chat_id");
|
|
});
|
|
|
|
it("resolves open IDs by ou_ prefix", () => {
|
|
expect(resolveReceiveIdType("ou_123")).toBe("open_id");
|
|
});
|
|
|
|
it("defaults unprefixed IDs to user_id", () => {
|
|
expect(resolveReceiveIdType("u_123")).toBe("user_id");
|
|
});
|
|
});
|