aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/test-locate.mjs
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-24 18:10:38 -0400
committerCraig Jennings <c@cjennings.net>2026-06-24 18:10:38 -0400
commitfd1969eda49b2e6c562439ecea9430ace164e16d (patch)
treec4a9f3874987300845ec180758191d6e59beb163 /scripts/theme-studio/test-locate.mjs
parent201a1174ce1e6004087fc53271deac7eac22555a (diff)
downloaddotemacs-fd1969eda49b2e6c562439ecea9430ace164e16d.tar.gz
dotemacs-fd1969eda49b2e6c562439ecea9430ace164e16d.zip
refactor(theme-studio): tier-1 simplification pass
These are behavior-preserving cleanups from the refactor/simplify assessment, all test-verified. I merged syncMockHeight and syncPkgHeight into one syncPaneHeight(tableId, paneId), inlined the two single-use displayHex/displayName closures, dropped a pkgbody guard that buildPkgTable already does, and had paintUI call worstCellHtml instead of rebuilding the covered-contrast cell. I deleted the dead generatorHues "manual" branch (a copy of the fallback) and locateInfoLine (orphaned when I removed the preview info line earlier today). The two nerd-icons loaders now share _load_nerd_icons_artifact, with a sentinel so a null-file edge keeps its exact behavior. face_coverage.classify reads through named locals now, guarded by a new characterization test. Two assessment findings were wrong and skipped after I checked them against the code: LOCATE_REG is live (read by previewSpan), and normalizePaletteEntryCore doesn't exist.
Diffstat (limited to 'scripts/theme-studio/test-locate.mjs')
-rw-r--r--scripts/theme-studio/test-locate.mjs18
1 files changed, 1 insertions, 17 deletions
diff --git a/scripts/theme-studio/test-locate.mjs b/scripts/theme-studio/test-locate.mjs
index faac7f916..5e36aa808 100644
--- a/scripts/theme-studio/test-locate.mjs
+++ b/scripts/theme-studio/test-locate.mjs
@@ -8,7 +8,7 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import {
- buildLocateRegistry, locateFaceMeta, formatLocateTitle, previewFaceAttrs, isLocateOnPane, locateInfoLine,
+ buildLocateRegistry, locateFaceMeta, formatLocateTitle, previewFaceAttrs, isLocateOnPane,
} from './app-core.js';
// A constructed model: two package apps that BOTH own a face literally named
@@ -142,22 +142,6 @@ test('formatLocateTitle: Error — an unassigned meta reads "unassigned"', () =>
assert.equal(formatLocateTitle(locateFaceMeta('org-faces', 'ghost', reg)), 'ghost, unassigned');
});
-// --- locateInfoLine: "section > face — value" -------------------------------
-
-test('locateInfoLine: Normal — section > face — value (fg only, then fg / bg)', () => {
- const reg = buildLocateRegistry(APPS, PKGMAP, UIMAP, MAP);
- assert.equal(locateInfoLine(locateFaceMeta('org-faces', 'org-todo', reg)), 'org-faces > org-todo — #cc3333');
- const pkgmap = { app: { face: { fg: '#aabbcc', bg: '#223344', inherit: null, source: 'user' } } };
- const apps = { app: { label: 'App', faces: [['face', 'F', {}]] } };
- const reg2 = buildLocateRegistry(apps, pkgmap, {}, MAP);
- assert.equal(locateInfoLine(locateFaceMeta('app', 'face', reg2)), 'App > face — #aabbcc / #223344');
-});
-
-test('locateInfoLine: Error — an unassigned meta reads "<face> — unassigned"', () => {
- const reg = buildLocateRegistry(APPS, PKGMAP, UIMAP, MAP);
- assert.equal(locateInfoLine(locateFaceMeta('org-faces', 'ghost', reg)), 'ghost — unassigned');
-});
-
// --- previewFaceAttrs: owner-aware validation -------------------------------
test('previewFaceAttrs: Normal — a known owner/face validates; a bad owner is rejected', () => {