test (tui): cover assistant default-foreground theme behavior

This commit is contained in:
Vignesh Natarajan
2026-02-14 19:08:19 -08:00
parent 2c962ef8fc
commit c14eb2b60e

View File

@@ -7,7 +7,7 @@ const cliHighlightMocks = vi.hoisted(() => ({
vi.mock("cli-highlight", () => cliHighlightMocks);
const { markdownTheme } = await import("./theme.js");
const { markdownTheme, theme } = await import("./theme.js");
const stripAnsi = (str: string) =>
str.replace(new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, "g"), "");
@@ -52,3 +52,10 @@ describe("markdownTheme", () => {
});
});
});
describe("theme", () => {
it("keeps assistant text in terminal default foreground", () => {
expect(theme.assistantText("hello")).toBe("hello");
expect(stripAnsi(theme.assistantText("hello"))).toBe("hello");
});
});