Light palette, chosen from the terminal's background or the Colours setting

This commit is contained in:
Callum Alpass committed 2026-11-02 23:21:55 +11:00
1 parent 3ef67c5b50
commit 49fc25f7a2
11 files changed
+91 -42

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import { afterEach, expect, test } from "bun:test";
import { applyTheme, colors, statusColor, toneColor } from "../src/ui/theme.ts";
afterEach(() => applyTheme("dark"));
test("the light palette replaces every colour, and the tone maps follow it", () => {
const dark = { ...colors };
applyTheme("light");
for (const key of Object.keys(dark) as (keyof typeof dark)[]) expect(colors[key]).not.toBe(dark[key]);
expect(statusColor("bad")).toBe(colors.bad);
expect(toneColor("normal")).toBe(colors.text);
applyTheme("dark");
expect(colors).toEqual(dark);
});