Goldens: three variants at 1x density (sv_light, sv_dark, en_light; D-098)

Drop the en_dark variant from every screenshot helper and render every
golden at mdpi (Robolectric qualifier w411dp-h<height>dp-mdpi instead of
xhdpi/xxhdpi), so a 411 x 891 dp screen is 411 x 891 px. All goldens
deleted and re-recorded; 1143 -> 865 PNGs. README describes the layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
2026-10-18 21:24:30 +02:00
parent bfde12cead
commit 75b549fb4f
21 changed files with 42 additions and 36 deletions
@@ -39,7 +39,7 @@ import se.hagstedt.kvitt.model.RangePreset
*/
@RunWith(ParameterizedRobolectricTestRunner::class)
@GraphicsMode(GraphicsMode.Mode.NATIVE)
@Config(sdk = [36], qualifiers = "w411dp-h891dp-xhdpi")
@Config(sdk = [36], qualifiers = "w411dp-h891dp-mdpi")
class AnalyticsScreenshotTest(private val name: String) {
@get:Rule
val compose = createComposeRule()
@@ -22,7 +22,7 @@ import se.hagstedt.kvitt.model.RangePreset
/** S-12 in every state of PLAN-M7e §5, × light/dark × sv/en (plus 200 % for long content). */
@RunWith(ParameterizedRobolectricTestRunner::class)
@GraphicsMode(GraphicsMode.Mode.NATIVE)
@Config(sdk = [36], qualifiers = "w411dp-h891dp-xhdpi")
@Config(sdk = [36], qualifiers = "w411dp-h891dp-mdpi")
class DrillDownScreenshotTest(private val name: String) {
@get:Rule
val compose = createComposeRule()
@@ -32,8 +32,8 @@ import java.util.Locale
import kotlin.time.Instant
/**
* Captures a whole screen (411 × 891 dp, the Galaxy S26 of SPEC §13.1) once per language and theme:
* `src/test/screenshots/<name>_<sv|en>_<light|dark>.png`, plus `<name>_sv_light_200.png` with [largeFont] (200 %,
* Captures a whole screen (411 × 891 dp, the Galaxy S26 of SPEC §13.1) in three variants (Swedish light and dark, English light; D-098):
* `src/test/screenshots/<name>_<sv_light|sv_dark|en_light>.png`, plus `<name>_sv_light_200.png` with [largeFont] (200 %,
* like the design spec's 200 % frames). The clock is the fakes' today (17 October 2026, 14:02 in Stockholm) and the
* viewer is Jacob. Language, theme and font scale switch through a configuration context, as in :core:design's tests;
* the content is recreated per variant so remembered state (scroll, picker) starts fresh.
@@ -46,7 +46,7 @@ object ScreenSnapshots {
}
fun snap(compose: ComposeContentTestRule, name: String, largeFont: Boolean = false, content: @Composable () -> Unit) {
val variants = listOf("sv", "en").flatMap { l -> listOf(false, true).map { Variant(l, it, 1f) } } +
val variants = listOf(Variant("sv", dark = false, fontScale = 1f), Variant("sv", dark = true, fontScale = 1f), Variant("en", dark = false, fontScale = 1f)) +
if (largeFont) listOf(Variant("sv", dark = false, fontScale = 2f)) else emptyList()
var current by mutableStateOf(variants.first())
compose.setContent {