diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-24 19:17:23 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-24 19:17:23 -0400 |
| commit | 9e445ab334368dc800728e89fc74ee7c69cbab09 (patch) | |
| tree | a2bd28fb87dc490c229860a5d32d36769108b4a9 /scripts/theme-studio/test-locate.mjs | |
| parent | 721ed551c7d22f0ab5855e8c2e7c2d9264147e92 (diff) | |
| download | dotemacs-9e445ab334368dc800728e89fc74ee7c69cbab09.tar.gz dotemacs-9e445ab334368dc800728e89fc74ee7c69cbab09.zip | |
refactor(theme-studio): extract control factories to controls.js, drop dead previewFaceAttrs
I split the custom dropdown, detail-editor, and expander factories out of app.js into controls.js (205 lines), spliced back at a CONTROLS_J token by generate.py. The token sits at the exact extraction point, so the assembled page is byte-identical and every gate passes unchanged. app.js drops from 927 to 721 lines.
I also removed previewFaceAttrs (function, export, and test). It was test-only dead code whose docstring stalely claimed the gate calls it. The gate uses assertPreviewFaces instead.
Diffstat (limited to 'scripts/theme-studio/test-locate.mjs')
| -rw-r--r-- | scripts/theme-studio/test-locate.mjs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/scripts/theme-studio/test-locate.mjs b/scripts/theme-studio/test-locate.mjs index 5e36aa808..09d15b8bc 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, + buildLocateRegistry, locateFaceMeta, formatLocateTitle, isLocateOnPane, } from './app-core.js'; // A constructed model: two package apps that BOTH own a face literally named @@ -142,15 +142,6 @@ test('formatLocateTitle: Error — an unassigned meta reads "unassigned"', () => assert.equal(formatLocateTitle(locateFaceMeta('org-faces', 'ghost', reg)), 'ghost, unassigned'); }); -// --- previewFaceAttrs: owner-aware validation ------------------------------- - -test('previewFaceAttrs: Normal — a known owner/face validates; a bad owner is rejected', () => { - const reg = buildLocateRegistry(APPS, PKGMAP, UIMAP, MAP); - assert.ok(previewFaceAttrs('org-faces', 'org-todo', reg), 'known face validates'); - assert.equal(previewFaceAttrs('org-mode', 'minibuffer-prompt', reg), null, 'a UI face under a package owner is rejected'); - assert.equal(previewFaceAttrs('nope', 'org-todo', reg), null, 'an unknown owner is rejected'); -}); - // --- lifecycle + perf ------------------------------------------------------- test('buildLocateRegistry: lifecycle — a rebuild after an edit reflects the new value', () => { |
