15670fad172c
test: verify light theme already complete (PeachPalette/LocalPeachColors/peachDark+peachLight/MainActivity wiring/forced-dark Settings all present; zero PeachColors.* call-site refs) + PeachPaletteTest 8 tests pinning dark/light factories; v2.2.6 (369 tests)
- time
- 2026-06-10 13:08 UTC · 5 months ago
- machine
- koh2
- agent
- claude-opus-4-8
- session
- light theme regression lock
- parent
- a5111eb08f87
↓ peach-android-15670fad.tar.gzatlas at this save
files changed1 file
app/src/test/java/com/peachpasswords/ui/theme/PeachPaletteTest.kt+57 −0app/src/test/java/com/peachpasswords/ui/theme/PeachPaletteTest.kt+57 −0
@@ -0,0 +1,57 @@1+package com.peachpasswords.ui.theme2+3+import androidx.compose.ui.graphics.Color4+import org.junit.Assert.assertEquals5+import org.junit.Assert.assertFalse6+import org.junit.Assert.assertNotEquals7+import org.junit.Assert.assertTrue8+import org.junit.Test9+10+/**11+ * Light-theme regression lock (F brief). The light theme is wired through12+ * [peachDark] / [peachLight] + [LocalPeachColors]; these pin the palette factories13+ * so a future change can't silently reintroduce the dark-only singleton or turn14+ * the warm parchment background into flat white.15+ */16+class PeachPaletteTest {17+18+ @Test fun dark_palette_is_marked_dark() {19+ assertTrue(peachDark().isDark)20+ }21+22+ @Test fun light_palette_is_marked_light() {23+ assertFalse(peachLight().isDark)24+ }25+26+ @Test fun light_background_is_warm_parchment_not_white() {27+ assertEquals(Color(0xFFEFEEE9), peachLight().Bg)28+ assertNotEquals(Color.White, peachLight().Bg)29+ }30+31+ @Test fun dark_background_is_near_black() {32+ assertEquals(Color(0xFF0C0A06), peachDark().Bg)33+ }34+35+ @Test fun text_inverts_between_themes() {36+ // Dark T0 is light parchment text; light T0 is near-black ink.37+ assertEquals(Color(0xFFF0E8D8), peachDark().T0)38+ assertEquals(Color(0xFF1A1208), peachLight().T0)39+ assertNotEquals(peachDark().T0, peachLight().T0)40+ }41+42+ @Test fun accent_is_carried_into_both_palettes() {43+ val custom = Color(0xFF123456)44+ assertEquals(custom, peachDark(custom).Accent)45+ assertEquals(custom, peachLight(custom).Accent)46+ }47+48+ @Test fun default_accent_used_when_unspecified() {49+ assertEquals(DEFAULT_ACCENT, peachDark().Accent)50+ assertEquals(DEFAULT_ACCENT, peachLight().Accent)51+ }52+53+ @Test fun light_and_dark_surfaces_differ() {54+ assertNotEquals(peachDark().S1, peachLight().S1)55+ assertNotEquals(peachDark().SurfaceElevated, peachLight().SurfaceElevated)56+ }57+}