mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
test (tui): cover assistant default-foreground theme behavior
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user