From 364dbeedbd5ce99ae406636901d70f70744dea1b Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sun, 16 Aug 2026 15:14:53 +0800 Subject: [PATCH] test(themes): keep every built-in on the page that lists them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The themes page names all nine one by one and its description counts them, so a tenth added to `BUILTINS` would leave the page wrong twice over: a theme in the picker that nobody wrote down, under a sentence claiming nine. Themes are the kind of thing that gets added. Matched on display names, because the page is written for someone reading the picker — `rose_pine` is "Rosé Pine" there, accent and all. Dropping Harbor from the page fails it. The check that prompted this found nothing wrong anywhere else, which is worth recording: all nine themes, all eighteen detected agents, and all seven agents with installable hooks are already named on their pages. Two of those looked like gaps first time round and were mine, not the docs': `harbor` matched nothing because the page says "Harbor", and `OhMyPi` because it says "Oh My Pi". A name-matching sweep is only as good as its idea of how names are written. --- src/ui/presets.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/ui/presets.rs b/src/ui/presets.rs index 084642b9..1c225863 100644 --- a/src/ui/presets.rs +++ b/src/ui/presets.rs @@ -1288,6 +1288,32 @@ mod tests { } } + /// Every built-in theme is on the page that lists them. + /// + /// The page names them one by one and calls them "Nine built-ins", so a + /// tenth added here leaves the page wrong in two places at once — a + /// reader counting the table against the picker finds a theme nobody + /// wrote down. + /// + /// Display names rather than ids, because the page is written for someone + /// reading the picker: `rose_pine` is "Rosé Pine" there, accent and all. + #[test] + fn every_built_in_theme_is_on_the_themes_page() { + const PAGE: &str = include_str!("../../docs/customization/themes.mdx"); + + let mut absent = Vec::new(); + for theme in builtins() { + if !PAGE.contains(&theme.name) { + absent.push(theme.name.clone()); + } + } + assert!( + absent.is_empty(), + "these built-in themes are not on the themes page: {absent:?}" + ); + assert_eq!(builtins().len(), 9, "the page's description counts them"); + } + #[test] fn dark_is_inferred_from_background() { let dark: Vec<_> = builtins()