fix(config): apply defaults to perplexity UI

This commit is contained in:
Ivan Pereira
2026-03-21 20:54:41 +00:00
parent 11c543c0de
commit 041d30651a
13 changed files with 600 additions and 45 deletions
+47
View File
@@ -0,0 +1,47 @@
import { describe, expect, test } from "bun:test";
import { renderPerplexityCall } from "../src/render/call.js";
import { renderPerplexityResult } from "../src/render/result.js";
const theme = {
fg: (_color: string, text: string) => text,
bold: (text: string) => text,
} as any;
describe("renderPerplexityCall", () => {
test("shows the selected model in the tool call row", () => {
const rendered = renderPerplexityCall(
{
query: "latest bun release notes",
model: "claude46sonnetthinking",
recency: "week",
limit: 5,
},
theme,
).render(200).join("\n");
expect(rendered).toContain("claude46sonnetthinking");
expect(rendered).toContain("week");
expect(rendered).toContain("limit 5");
});
});
describe("renderPerplexityResult", () => {
test("shows the model in the collapsed success row", () => {
const rendered = renderPerplexityResult(
{
content: [{ type: "text", text: "Result summary" }],
details: {
model: "gpt54",
sourceCount: 3,
queryMs: 800,
},
} as any,
{ expanded: false, isPartial: false } as any,
theme,
).render(200).join("\n");
expect(rendered).toContain("gpt54");
expect(rendered).toContain("3 sources");
});
});