test(tui): make snapshots independent of local settings

This commit is contained in:
objz committed 2026-09-25 11:22:49 +02:00
1 parent 9d480f8bfb
commit 28c0731478
3 files changed
+12 -3

No files matched your search

+9 -2
View File
@@ -77,6 +77,7 @@ impl Default for ThemeConfig {
}
}
#[cfg(not(test))]
fn load_theme_config() -> ThemeConfig {
let path = super::get_config_path().join("theme.toml");
ensure_theme_exists(&path);
@@ -89,6 +90,7 @@ fn load_theme_config() -> ThemeConfig {
}
}
#[cfg(not(test))]
fn ensure_theme_exists(path: &Path) {
if path.exists() {
return;
@@ -207,8 +209,13 @@ impl BorderStyleStore {
}
}
static THEME_CONFIG: LazyLock<RwLock<ThemeConfig>> =
LazyLock::new(|| RwLock::new(load_theme_config()));
static THEME_CONFIG: LazyLock<RwLock<ThemeConfig>> = LazyLock::new(|| {
#[cfg(test)]
let config = ThemeConfig::default();
#[cfg(not(test))]
let config = load_theme_config();
RwLock::new(config)
});
pub static THEME: LazyLock<ThemeStore> = LazyLock::new(|| {
let config = THEME_CONFIG