Files
oh-my-pi/packages/coding-agent/test/theme-islight.test.ts
T
can1357 9d457f73d9 test: migrated test imports to package subpath exports
- Replaced relative `../src` imports with `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-agent-core` subpaths.
2026-06-08 19:03:55 +02:00

23 lines
1.1 KiB
TypeScript

import { describe, expect, it } from "bun:test";
import { getThemeByName } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
describe("Theme.isLight", () => {
it("classifies built-in themes by their status-line surface", async () => {
// porcelain styles a dark chat bubble (userMessageBg) on an otherwise-light
// theme with a light status line. Session accents render on the status line,
// so it must read as light — classifying by userMessageBg got this wrong.
expect((await getThemeByName("porcelain"))?.isLight).toBe(true);
expect((await getThemeByName("light-catppuccin"))?.isLight).toBe(true);
expect((await getThemeByName("dark-catppuccin"))?.isLight).toBe(false);
});
it("exposes the status-line surface luminance for accent sizing", async () => {
const light = await getThemeByName("light-catppuccin");
const dark = await getThemeByName("dark-catppuccin");
// Light themes hand the real surface luminance to getSessionAccentHex...
expect(light?.accentSurfaceLuminance).toBeGreaterThan(0.5);
// ...dark themes pass undefined so accents stay vivid.
expect(dark?.accentSurfaceLuminance).toBeUndefined();
});
});