From c33455e9ad7e1d748f755766b6e5688c90f5f602 Mon Sep 17 00:00:00 2001 From: Adil Hanney Date: Wed, 1 Apr 2026 18:01:16 +0100 Subject: [PATCH] test: use default dark theme, not real system theme --- cosmic-theme/src/output/qt_output.rs | 3 +++ ...ut__tests__light_default_kcolorscheme.snap | 24 +++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/cosmic-theme/src/output/qt_output.rs b/cosmic-theme/src/output/qt_output.rs index 5b36971..d42d553 100644 --- a/cosmic-theme/src/output/qt_output.rs +++ b/cosmic-theme/src/output/qt_output.rs @@ -94,6 +94,9 @@ impl Theme { let complementary_colors = { let dark = if self.is_dark { self.clone() + } else if cfg!(test) { + // For reproducible results in tests, use the default dark theme + Theme::dark_default() } else { Theme::dark_config() .ok() diff --git a/cosmic-theme/src/output/snapshots/cosmic_theme__output__qt_output__tests__light_default_kcolorscheme.snap b/cosmic-theme/src/output/snapshots/cosmic_theme__output__qt_output__tests__light_default_kcolorscheme.snap index 12c511f..ae2bcb6 100644 --- a/cosmic-theme/src/output/snapshots/cosmic_theme__output__qt_output__tests__light_default_kcolorscheme.snap +++ b/cosmic-theme/src/output/snapshots/cosmic_theme__output__qt_output__tests__light_default_kcolorscheme.snap @@ -39,18 +39,18 @@ ForegroundPositive=0,87,44 ForegroundVisited=0,82,90 [Colors:Complementary] -BackgroundAlternate=129,196,88 -BackgroundNormal=12,17,6 -DecorationFocus=129,196,88 -DecorationHover=129,196,88 -ForegroundActive=129,196,88 -ForegroundInactive=191,198,186 -ForegroundLink=129,196,88 -ForegroundNegative=253,161,160 -ForegroundNeutral=247,224,98 -ForegroundNormal=211,218,206 -ForegroundPositive=146,207,156 -ForegroundVisited=129,196,88 +BackgroundAlternate=99,208,223 +BackgroundNormal=27,27,27 +DecorationFocus=99,208,223 +DecorationHover=99,208,223 +ForegroundActive=99,208,223 +ForegroundInactive=211,211,211 +ForegroundLink=99,208,223 +ForegroundNegative=255,160,154 +ForegroundNeutral=255,163,125 +ForegroundNormal=231,231,231 +ForegroundPositive=94,219,140 +ForegroundVisited=99,208,223 [Colors:Header] BackgroundAlternate=204,208,209