aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/test_generate.py
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-02 13:29:37 -0400
committerCraig Jennings <c@cjennings.net>2026-07-02 13:29:37 -0400
commit172c00e0a450309938bb4e87e612c715707ab1cf (patch)
tree51564dff134e65bad9625377c79a3deffa965e4d /scripts/theme-studio/test_generate.py
parent8a93f68c10770c592468862dc9ec08386b291447 (diff)
downloaddotemacs-172c00e0a450309938bb4e87e612c715707ab1cf.tar.gz
dotemacs-172c00e0a450309938bb4e87e612c715707ab1cf.zip
feat(theme-studio): realistic scenes for company, transient, and friends
Five daily-driver apps leave the generic face-name list: company (a completion popup with every row variant, inline ghost preview, tooltip search, and the echo frontend), company-box (the icons variant), transient (a magit-commit-style panel exercising every key class), magit-section (status-buffer headings with child counts and the highlighted section), and rainbow-delimiters (buffer-honest nesting depths 1-9 plus the cycle past 9 and both error faces). A new test gates realism: every face of each covered app must appear verbatim in its renderer, so a scene can't silently skip faces.
Diffstat (limited to 'scripts/theme-studio/test_generate.py')
-rw-r--r--scripts/theme-studio/test_generate.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/theme-studio/test_generate.py b/scripts/theme-studio/test_generate.py
index e53bdd62..7fb0b60f 100644
--- a/scripts/theme-studio/test_generate.py
+++ b/scripts/theme-studio/test_generate.py
@@ -848,5 +848,33 @@ class PinnedPackages(unittest.TestCase):
self.assertIn("all-the-icons-blue", faces)
+class BespokePreviewFaceCoverage(unittest.TestCase):
+ """Realism gate for the bespoke scenes built over inventory apps: a scene
+ that skips faces silently reads as "themed everything" when it didn't.
+ Every face of each app listed here must appear verbatim in previews.js."""
+
+ FULL_COVERAGE_APPS = [
+ "company", "company-box", "transient", "magit-section",
+ "rainbow-delimiters",
+ ]
+
+ def test_every_face_appears_in_the_renderer(self):
+ with open(os.path.join(os.path.dirname(__file__), "previews.js")) as f:
+ body = f.read()
+ missing = []
+ for app in self.FULL_COVERAGE_APPS:
+ for face, _label, _seed in generate.APPS[app]["faces"]:
+ # Renderers build names as prefix+suffix (os(a,'company-'+f,..)),
+ # so accept the bare suffix appearing after the app prefix too.
+ suffix = face
+ for prefix in (app + "-", "magit-", "rainbow-delimiters-"):
+ if face.startswith(prefix):
+ suffix = face[len(prefix):]
+ break
+ if face not in body and suffix not in body:
+ missing.append(face)
+ self.assertEqual(missing, [])
+
+
if __name__ == "__main__":
unittest.main()