Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

themePreview.test.ts

20 lines794 Bytes

1import { describe, expect, it } from "@effect/vitest";
2​
3import {
4 mixThemePreviewBase,
5 STANDARD_THEME_PREVIEW_COLORS,
6 THEME_PREVIEW_RENDER_SPECS,
7} from "./themePreview.js";
8​
9describe("theme preview", () => {
10 it("keeps the desktop preview geometry stable across clients", () => {
11 expect(THEME_PREVIEW_RENDER_SPECS.light!.accent.center).toEqual([0.72, 0.22]);
12 expect(THEME_PREVIEW_RENDER_SPECS.dark!.accent.middleOpacity).toBe(0.62);
13 expect(THEME_PREVIEW_RENDER_SPECS.dark!.action.center).toEqual([0.82, 0.18]);
14 });
15​
16 it("mixes the standard canvas bases in OKLab", () => {
17 expect(mixThemePreviewBase(STANDARD_THEME_PREVIEW_COLORS.light!, "light")).toBe("#fdfdfd");
18 expect(mixThemePreviewBase(STANDARD_THEME_PREVIEW_COLORS.dark!, "dark")).toBe("#0a0a0a");
19 });
20});