Files
oh-my-pi/packages/coding-agent/test/tools/find-renderer.test.ts
T
can1357 3c1a31062c ux(coding-agent): refined tool renderers with padded status headers
- Updated read-group rendering to use the enabled success mark and omitted duplicate success marks on child files in grouped reads.
- Adjusted find and search renderers to apply tool-title coloring, search icons, and padded layout via createCachedComponent.
- Added tests covering read-group success marking and padded find/search renderer output.
2026-06-07 09:03:09 +02:00

29 lines
1.1 KiB
TypeScript

import { describe, expect, it } from "bun:test";
import { sanitizeText } from "@oh-my-pi/pi-utils";
import { getThemeByName } from "../../src/modes/theme/theme";
import { findToolRenderer } from "../../src/tools/find";
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"));
});
});