Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

580 B
Raw Blame
import { describe, expect, it } from "vitest";

import { decodeLaneUserId, encodeLaneUserId } from "../codec.js";

describe("dingtalk lane codec", () => {
  it("round-trips group conversation ids without leaking separators", () => {
    const encoded = encodeLaneUserId("cid/a b");
    expect(encoded).toBe("g/cid%2Fa%20b");
    expect(decodeLaneUserId(encoded)).toEqual({ conversationId: "cid/a b" });
  });

  it("does not treat direct user ids as group lanes", () => {
    expect(decodeLaneUserId("user-1")).toBeNull();
    expect(decodeLaneUserId("g/")).toBeNull();
  });
});