Files
AgentCompany/tests/unit/capability-registry.test.ts
T
2026-05-15 19:40:20 -04:00

45 lines
1.6 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { buildCapabilityRegistrySection } from "@main/prompt-builder/capability-registry";
describe("buildCapabilityRegistrySection", () => {
it("renders a company-wide capability summary for delegation decisions", () => {
const section = buildCapabilityRegistrySection({
companySkillCatalog: [
{ name: "React Standards", slug: "react-standards", description: "Use when building React UI" },
],
companyWorkspaces: [
{ id: "workspace-1", name: "Primary", localPath: "/tmp/workspace" },
],
allConnectors: [
{ id: "openai-codex", label: "Codex", status: "ready", enabledModels: ["gpt-5.4"] },
],
companyDocuments: [
{
id: "doc-1",
companyId: "company-1",
title: "Architecture Decision",
type: "architecture_decision",
content: "",
status: "approved",
authorAgentId: null,
reviewerAgentId: null,
projectId: null,
goalId: null,
parentDocId: null,
version: 1,
tagsJson: "[]",
latestRevisionId: null,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
],
});
expect(section).toContain("# Company Capability Registry");
expect(section).toContain("React Standards (`react-standards`)");
expect(section).toContain("Primary (`workspace-1`): /tmp/workspace");
expect(section).toContain("Codex (`openai-codex`) — models: gpt-5.4");
expect(section).toContain("architecture_decision");
});
});