Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

606 B
Raw Blame
import { describe, expect, it } from "vite-plus/test";

import { createPreviewAutomationClientId } from "./previewAutomationClientId";

describe("createPreviewAutomationClientId", () => {
  it("creates bounded cryptographically random identities for independent host lifetimes", () => {
    const clientIds = Array.from({ length: 32 }, createPreviewAutomationClientId);

    expect(new Set(clientIds).size).toBe(clientIds.length);
    expect(clientIds.every((clientId) => clientId.startsWith("preview-"))).toBe(true);
    expect(clientIds.every((clientId) => clientId.length <= 128)).toBe(true);
  });
});