9d457f73d9
- Replaced relative `../src` imports with `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-agent-core` subpaths.
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import { getThemeByName } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
|
|
import { findToolRenderer } from "@oh-my-pi/pi-coding-agent/tools/find";
|
|
import { sanitizeText } from "@oh-my-pi/pi-utils";
|
|
|
|
describe("findToolRenderer", () => {
|
|
it("indents inline find output and avoids accent-colored success headers", async () => {
|
|
const theme = await getThemeByName("dark");
|
|
expect(theme).toBeDefined();
|
|
const uiTheme = theme!;
|
|
const result = {
|
|
content: [{ type: "text", text: "" }],
|
|
details: {
|
|
fileCount: 2,
|
|
files: ["src/a.ts", "src/b.ts"],
|
|
},
|
|
};
|
|
|
|
const renderedLines = findToolRenderer
|
|
.renderResult(result as never, { expanded: true, isPartial: false }, uiTheme, { paths: "src/**/*.ts" })
|
|
.render(240);
|
|
const plainLines = sanitizeText(renderedLines.join("\n")).split("\n");
|
|
|
|
expect(plainLines.every(line => line.startsWith(" "))).toBe(true);
|
|
expect(renderedLines[0]).not.toContain(uiTheme.fg("accent", uiTheme.symbol("icon.search")));
|
|
expect(renderedLines[0]).not.toContain(uiTheme.fg("accent", "Find"));
|
|
});
|
|
});
|