PeachPaletteTest.kt

1.9 KB · raw

1package com.peachpasswords.ui.theme23import androidx.compose.ui.graphics.Color4import org.junit.Assert.assertEquals5import org.junit.Assert.assertFalse6import org.junit.Assert.assertNotEquals7import org.junit.Assert.assertTrue8import org.junit.Test910/**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 */16class PeachPaletteTest {1718    @Test fun dark_palette_is_marked_dark() {19        assertTrue(peachDark().isDark)20    }2122    @Test fun light_palette_is_marked_light() {23        assertFalse(peachLight().isDark)24    }2526    @Test fun light_background_is_warm_parchment_not_white() {27        assertEquals(Color(0xFFEFEEE9), peachLight().Bg)28        assertNotEquals(Color.White, peachLight().Bg)29    }3031    @Test fun dark_background_is_near_black() {32        assertEquals(Color(0xFF0C0A06), peachDark().Bg)33    }3435    @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    }4142    @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    }4748    @Test fun default_accent_used_when_unspecified() {49        assertEquals(DEFAULT_ACCENT, peachDark().Accent)50        assertEquals(DEFAULT_ACCENT, peachLight().Accent)51    }5253    @Test fun light_and_dark_surfaces_differ() {54        assertNotEquals(peachDark().S1, peachLight().S1)55        assertNotEquals(peachDark().SurfaceElevated, peachLight().SurfaceElevated)56    }57}