import { describe, expect, it } from "vitest"; import { buildPullfrogFooter } from "./buildPullfrogFooter.ts"; describe("buildPullfrogFooter — fallbackFrom annotation", () => { it("renders the provider display name when fallbackFrom is set", () => { const footer = buildPullfrogFooter({ model: "opencode/minimax-m2.5-free", fallbackFrom: "anthropic/claude-opus", }); expect(footer).toContain( "Using `MiniMax M2.5` (free) (credentials for Anthropic not configured)" ); }); it("works for OpenAI's display name too", () => { const footer = buildPullfrogFooter({ model: "opencode/minimax-m2.5-free", fallbackFrom: "openai/gpt", }); expect(footer).toContain("(credentials for OpenAI not configured)"); }); it("falls back to the raw provider key when the slug provider is unknown to the catalog", () => { const footer = buildPullfrogFooter({ model: "opencode/minimax-m2.5-free", fallbackFrom: "some-unknown/model", }); expect(footer).toContain("(credentials for some-unknown not configured)"); }); it("omits the annotation when fallbackFrom is not set", () => { const footer = buildPullfrogFooter({ model: "anthropic/claude-opus", }); expect(footer).toContain("Using `Claude Opus`"); expect(footer).not.toContain("not configured"); }); });