import { describe, expect, it } from "vitest"; import { resolveBundledSetupConcept, setupContentKey } from "../setup-content"; import type { SetupContentBundle } from "../setup-content"; const bundle: SetupContentBundle = { version: 1, concepts: { "langgraph-python::agent-setup": { framework: "langgraph-python", concept: "agent-setup", source: "# LangGraph setup\n", }, }, }; describe("setup content bundle", () => { it("uses framework and concept as the stable lookup key", () => { expect(setupContentKey("langgraph-python", "agent-setup")).toBe( "langgraph-python::agent-setup", ); }); it("returns the bundled source when the framework concept exists", () => { expect( resolveBundledSetupConcept("langgraph-python", "agent-setup", bundle), ).toBe("# LangGraph setup\n"); }); it("falls back from LangGraph FastAPI to the Python setup content", () => { expect( resolveBundledSetupConcept("langgraph-fastapi", "agent-setup", bundle), ).toBe("# LangGraph setup\n"); }); it("returns null when the framework concept is absent", () => { expect( resolveBundledSetupConcept("google-adk", "agent-setup", bundle), ).toBe(null); expect( resolveBundledSetupConcept("langgraph-python", "missing", bundle), ).toBe(null); }); });