Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
import { expect, it, vi } from "vitest";
import { fitGraphLabel } from "@/components/thread/graph-canvas";
it("fits long Unicode labels with bounded measurements and complete code points", () => {
const name = "π".repeat(255);
const measure = vi.fn((text: string) => Array.from(text).length);
const fitted = fitGraphLabel(name, measure);
expect(fitted).toBe(`${"π".repeat(127)}β¦`);
expect(measure.mock.calls.length).toBeLessThanOrEqual(10);
expect(fitGraphLabel("a.md", measure)).toBe("a.md");
});