Some checks failed
build-packages / resolve bundled mosh-client (push) Has been cancelled
build-packages / resolve bundled et-client (push) Has been cancelled
build-packages / build-macos (push) Has been cancelled
build-packages / build-windows (push) Has been cancelled
build-packages / build-linux-x64 (push) Has been cancelled
build-packages / build-linux-arm64 (push) Has been cancelled
build-packages / release (push) Has been cancelled
build-packages / update Nix release metadata (push) Has been cancelled
build-packages / bump homebrew tap (push) Has been cancelled
test / lint-and-test (push) Has been cancelled
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
build-et-binaries / build-linux-x64 (push) Has been cancelled
build-et-binaries / build-linux-arm64 (push) Has been cancelled
build-et-binaries / build-macos-universal (push) Has been cancelled
build-et-binaries / build-windows-x64 (push) Has been cancelled
build-et-binaries / release (push) Has been cancelled
112 lines
3.1 KiB
TypeScript
112 lines
3.1 KiB
TypeScript
import { describe, it } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
import {
|
|
DARK_UI_THEMES,
|
|
EXTENDED_DARK_UI_THEMES,
|
|
EXTENDED_LIGHT_UI_THEMES,
|
|
LIGHT_UI_THEMES,
|
|
getUiThemeById,
|
|
} from "./uiThemes";
|
|
import { TERMINAL_THEMES } from "./terminalThemes";
|
|
|
|
const SYSTEM_PRESET_THEME_IDS = [
|
|
"a-cup-of-coffee",
|
|
"abolkog",
|
|
"aurora",
|
|
"ayu",
|
|
"base16-flat",
|
|
"base16-mocha",
|
|
"blue-dolphin",
|
|
"calm-days-sober-nights-sky",
|
|
"catppuccin",
|
|
"chai",
|
|
"chinolor",
|
|
"cyberdyne",
|
|
"desert",
|
|
"django-reborn-again",
|
|
"espresso",
|
|
"eyehealth",
|
|
"flexoki",
|
|
"fox",
|
|
"garbage-oracle",
|
|
"github",
|
|
"gruvbox-material",
|
|
"homebrew",
|
|
"ic-orange-ppl",
|
|
"ikki",
|
|
"kanso-ink",
|
|
"kary-pro-colors",
|
|
"light-purple",
|
|
"mondrian",
|
|
"monochrome",
|
|
"monochrome-stone",
|
|
"monokai-pro-spectrum",
|
|
"monospace",
|
|
"noctis-azureus",
|
|
"noctis-hibernus",
|
|
"noir-essence",
|
|
"nord-midnight",
|
|
"notionish",
|
|
"phonebook",
|
|
"polychrome",
|
|
"purplepeter",
|
|
"rainglow-codecourse",
|
|
"rainglow-crisp",
|
|
"rainglow-lavender",
|
|
"remedy-tilted",
|
|
"rose-pine",
|
|
"selene-selenized",
|
|
"soft-color",
|
|
"tearout",
|
|
"tokyo-night",
|
|
"tomorrow-night-eighties",
|
|
"vaporizer-turquoise",
|
|
"xotopio",
|
|
"yuttari",
|
|
"zenbones-rosebones",
|
|
"zhxo-red",
|
|
];
|
|
|
|
describe("system preset UI themes", () => {
|
|
it("adds every imported preset at the same level as the existing UI themes", () => {
|
|
assert.deepEqual(EXTENDED_LIGHT_UI_THEMES.map((theme) => theme.id), SYSTEM_PRESET_THEME_IDS);
|
|
assert.deepEqual(EXTENDED_DARK_UI_THEMES.map((theme) => theme.id), SYSTEM_PRESET_THEME_IDS);
|
|
|
|
for (const id of SYSTEM_PRESET_THEME_IDS) {
|
|
assert.equal(getUiThemeById("light", id).id, id);
|
|
assert.equal(getUiThemeById("dark", id).id, id);
|
|
}
|
|
|
|
assert.equal(EXTENDED_LIGHT_UI_THEMES.length, 55);
|
|
assert.equal(EXTENDED_DARK_UI_THEMES.length, 55);
|
|
assert.equal(LIGHT_UI_THEMES.length, 7 + 55);
|
|
assert.equal(DARK_UI_THEMES.length, 7 + 55);
|
|
assert.equal([...LIGHT_UI_THEMES, ...DARK_UI_THEMES].filter((theme) => theme.collection !== undefined && theme.collection !== "core").length, 0);
|
|
});
|
|
|
|
it("keeps theme accents distinct from the original default blue", () => {
|
|
const originalDefaultBlue = "221.2 83.2% 53.3%";
|
|
const accents = new Set([
|
|
...EXTENDED_LIGHT_UI_THEMES.map((theme) => theme.tokens.accent),
|
|
...EXTENDED_DARK_UI_THEMES.map((theme) => theme.tokens.accent),
|
|
]);
|
|
|
|
assert.ok(accents.size > 20);
|
|
assert.ok(!accents.has(originalDefaultBlue));
|
|
});
|
|
|
|
it("adds matching terminal themes for every imported light and dark UI preset", () => {
|
|
const terminalThemeIds = new Set(TERMINAL_THEMES.map((theme) => theme.id));
|
|
assert.equal(terminalThemeIds.size, TERMINAL_THEMES.length);
|
|
|
|
for (const id of SYSTEM_PRESET_THEME_IDS) {
|
|
const lightTerminalTheme = TERMINAL_THEMES.find((theme) => theme.id === `system-${id}-light`);
|
|
const darkTerminalTheme = TERMINAL_THEMES.find((theme) => theme.id === `system-${id}-dark`);
|
|
|
|
assert.equal(lightTerminalTheme?.type, "light", id);
|
|
assert.equal(darkTerminalTheme?.type, "dark", id);
|
|
}
|
|
});
|
|
});
|