diff --git a/android/README.md b/android/README.md index 285125a..bd0eb17 100644 --- a/android/README.md +++ b/android/README.md @@ -15,7 +15,7 @@ compile, unit tests (including every vector of `contracts/test-vectors/`), lint | `:core:fakes` | `kvitt.android.library` | `FakeRepositories(scenario)`, `FakeScenarios.empty`; scenarios of feature X go in `fakes//` (added by M7a to M7f) | | `:data` | `kvitt.android.library` + KSP + Room 3 | Room entities and `KvittDatabase` v1, schema in `data/schemas/`; M5 owns the module | | `:adapter:fcm` | `kvitt.android.library` | shell; M8 owns it | -| `:feature:*` | `kvitt.android.feature` | screens built by M7a to M7f (landed 2026-10-18), goldens in `feature//src/test/screenshots/` (full screen 411 × 891 dp, xhdpi); top-level screens draw their own `KvittNavigationBar` (SPEC §13.2, D-071); M7g does the cleanups after M6b | +| `:feature:*` | `kvitt.android.feature` | screens built by M7a to M7f (landed 2026-10-18), goldens in `feature//src/test/screenshots/` (full screen 411 × 891 dp at 1x, D-098); top-level screens draw their own `KvittNavigationBar` (SPEC §13.2, D-071); M7g does the cleanups after M6b | | `:app` | `kvitt.android.application` + compose + hilt + Roborazzi | Application, MainActivity, goldens in `app/src/test/screenshots/`; release binds `:data` (`DataBindingsModule`, `e6ad858`), debug binds the fakes in `src/debug/.../DebugFakesModule.kt` (`72f21b2`) until M8 deletes it; M8 owns the module | ## Architecture check @@ -58,3 +58,9 @@ debug configuration, and, in `:core:model` and `:domain`, on an Android plugin, Roborazzi on Robolectric. `roborazzi.test.verify=true` in `gradle.properties` makes every unit-test run compare with the committed goldens. Re-record an intended change with `tools/gradle-serial.sh recordRoborazziDebug` and open every changed PNG before committing. + +Golden layout (D-098, revising D-066): three variants per state, `_sv_light.png`, `_sv_dark.png` and +`_en_light.png` (English covers string length, dark covers the theme; there is no `en_dark`), plus +`_sv_light_200.png` at 200 % font scale for the long states. Every capture renders at 1x density: the +Robolectric qualifier is `w411dp-hdp-mdpi`, so the Galaxy S26 viewport of 411 × 891 dp is 411 × 891 px and a +golden is a true 1x render, not a downscaled one. `:app`'s `empty_screen_.png` are the only other names. diff --git a/android/app/src/test/kotlin/se/hagstedt/kvitt/KvittEmptyScreenScreenshotTest.kt b/android/app/src/test/kotlin/se/hagstedt/kvitt/KvittEmptyScreenScreenshotTest.kt index d89bdb8..5ff389a 100644 --- a/android/app/src/test/kotlin/se/hagstedt/kvitt/KvittEmptyScreenScreenshotTest.kt +++ b/android/app/src/test/kotlin/se/hagstedt/kvitt/KvittEmptyScreenScreenshotTest.kt @@ -19,7 +19,7 @@ import se.hagstedt.kvitt.design.KvittTheme */ @RunWith(RobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) -@Config(sdk = [36], qualifiers = "w411dp-h891dp-xxhdpi", application = Application::class) +@Config(sdk = [36], qualifiers = "w411dp-h891dp-mdpi", application = Application::class) class KvittEmptyScreenScreenshotTest { @get:Rule val compose = createComposeRule() diff --git a/android/core/design/src/test/kotlin/se/hagstedt/kvitt/design/screenshot/ComponentScreenshotTest.kt b/android/core/design/src/test/kotlin/se/hagstedt/kvitt/design/screenshot/ComponentScreenshotTest.kt index f20da90..1a07fba 100644 --- a/android/core/design/src/test/kotlin/se/hagstedt/kvitt/design/screenshot/ComponentScreenshotTest.kt +++ b/android/core/design/src/test/kotlin/se/hagstedt/kvitt/design/screenshot/ComponentScreenshotTest.kt @@ -17,7 +17,7 @@ import se.hagstedt.kvitt.design.catalogue.LargeFontSheets */ @RunWith(ParameterizedRobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) -@Config(sdk = [36], qualifiers = "w411dp-h2400dp-xxhdpi") +@Config(sdk = [36], qualifiers = "w411dp-h2400dp-mdpi") class ComponentScreenshotTest(private val sheet: String) { @get:Rule val compose = createComposeRule() diff --git a/android/core/design/src/test/kotlin/se/hagstedt/kvitt/design/screenshot/Snapshots.kt b/android/core/design/src/test/kotlin/se/hagstedt/kvitt/design/screenshot/Snapshots.kt index b02fb65..db7b749 100644 --- a/android/core/design/src/test/kotlin/se/hagstedt/kvitt/design/screenshot/Snapshots.kt +++ b/android/core/design/src/test/kotlin/se/hagstedt/kvitt/design/screenshot/Snapshots.kt @@ -36,7 +36,7 @@ import java.util.Locale import kotlin.time.Instant /** - * Captures one golden per theme and language: `src/test/screenshots/__.png`, plus + * Captures three goldens (Swedish light and dark, English light; D-098): `src/test/screenshots/_.png`, plus * `_sv_light_200.png` when `largeFont` is set (200 % font scale, Swedish and light, like the spec's 200 % frames). * The content is set once; language (configuration, resources), theme and font scale (the platform's non-linear * scaling, from a configuration context) switch between captures. Width: the Galaxy S26, 411 dp (SPEC §13.1). The @@ -50,7 +50,7 @@ object Snapshots { } fun snap(compose: ComposeContentTestRule, name: String, largeFont: Boolean, content: @Composable ColumnScope.() -> 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 { diff --git a/android/feature/account/src/test/kotlin/se/hagstedt/kvitt/feature/account/ScreenSnapshots.kt b/android/feature/account/src/test/kotlin/se/hagstedt/kvitt/feature/account/ScreenSnapshots.kt index 3823556..eb7b383 100644 --- a/android/feature/account/src/test/kotlin/se/hagstedt/kvitt/feature/account/ScreenSnapshots.kt +++ b/android/feature/account/src/test/kotlin/se/hagstedt/kvitt/feature/account/ScreenSnapshots.kt @@ -30,13 +30,13 @@ import kotlin.time.Instant /** * Full-screen goldens of this module's screens, as M6's component snapshots but for whole screens (dialogs and menus - * included): `src/test/screenshots/__.png`, plus `_sv_light_200.png` at 200 % font - * scale for the long states. The screen is the Galaxy S26 (411 × 891 dp), at xhdpi to keep the goldens small. The + * included): `src/test/screenshots/_.png`, plus `_sv_light_200.png` at 200 % font + * scale for the long states. The screen is the Galaxy S26 (411 × 891 dp), at mdpi (1x) to keep the goldens small (D-098). The * clock is fixed at 17 October 2026 14:02 in Stockholm; the frame clock is advanced by hand so animations and * snackbars render the same every run. */ object ScreenSnapshots { - const val QUALIFIERS = "w411dp-h891dp-xhdpi" + const val QUALIFIERS = "w411dp-h891dp-mdpi" val clock = KvittClock.fixed(Instant.parse("2026-10-17T12:02:00Z"), TimeZone.of("Europe/Stockholm")) private const val SETTLE_MILLIS = 1_000L @@ -46,7 +46,7 @@ object ScreenSnapshots { @OptIn(ExperimentalRoborazziApi::class) fun snap(compose: ComposeContentTestRule, name: String, largeFont: Boolean, 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.mainClock.autoAdvance = false diff --git a/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/AnalyticsScreenshotTest.kt b/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/AnalyticsScreenshotTest.kt index 7331465..5e60fca 100644 --- a/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/AnalyticsScreenshotTest.kt +++ b/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/AnalyticsScreenshotTest.kt @@ -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() diff --git a/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/DrillDownScreenshotTest.kt b/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/DrillDownScreenshotTest.kt index 83d8fbe..0216b2e 100644 --- a/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/DrillDownScreenshotTest.kt +++ b/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/DrillDownScreenshotTest.kt @@ -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() diff --git a/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/ScreenSnapshots.kt b/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/ScreenSnapshots.kt index b3c4ba0..75919cc 100644 --- a/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/ScreenSnapshots.kt +++ b/android/feature/analytics/src/test/kotlin/se/hagstedt/kvitt/feature/analytics/screenshot/ScreenSnapshots.kt @@ -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/__.png`, plus `_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/_.png`, plus `_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 { diff --git a/android/feature/expense/src/test/kotlin/se/hagstedt/kvitt/feature/expense/screenshot/ExpenseScreenshotTest.kt b/android/feature/expense/src/test/kotlin/se/hagstedt/kvitt/feature/expense/screenshot/ExpenseScreenshotTest.kt index 150961e..c1c57cc 100644 --- a/android/feature/expense/src/test/kotlin/se/hagstedt/kvitt/feature/expense/screenshot/ExpenseScreenshotTest.kt +++ b/android/feature/expense/src/test/kotlin/se/hagstedt/kvitt/feature/expense/screenshot/ExpenseScreenshotTest.kt @@ -15,7 +15,7 @@ import org.robolectric.annotation.GraphicsMode */ @RunWith(ParameterizedRobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) -@Config(sdk = [36], qualifiers = "w411dp-h891dp-xxhdpi") +@Config(sdk = [36], qualifiers = "w411dp-h891dp-mdpi") class ExpenseScreenshotTest(private val name: String) { @get:Rule val compose = createComposeRule() @@ -36,7 +36,7 @@ class ExpenseScreenshotTest(private val name: String) { /** Long content on a tall frame (411 × 1600 dp) so the whole screen, including a long timeline, is in the golden. */ @RunWith(ParameterizedRobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) -@Config(sdk = [36], qualifiers = "w411dp-h1600dp-xxhdpi") +@Config(sdk = [36], qualifiers = "w411dp-h1600dp-mdpi") class ExpenseTallScreenshotTest(private val name: String) { @get:Rule val compose = createComposeRule() diff --git a/android/feature/expense/src/test/kotlin/se/hagstedt/kvitt/feature/expense/screenshot/ScreenSnapshots.kt b/android/feature/expense/src/test/kotlin/se/hagstedt/kvitt/feature/expense/screenshot/ScreenSnapshots.kt index b42451f..69efab8 100644 --- a/android/feature/expense/src/test/kotlin/se/hagstedt/kvitt/feature/expense/screenshot/ScreenSnapshots.kt +++ b/android/feature/expense/src/test/kotlin/se/hagstedt/kvitt/feature/expense/screenshot/ScreenSnapshots.kt @@ -31,7 +31,7 @@ import java.util.Locale import kotlin.time.Instant /** - * Captures one golden per language and theme of a whole screen: `src/test/screenshots/__.png`, + * Captures three goldens of a whole screen (Swedish light and dark, English light; D-098): `src/test/screenshots/_.png`, * plus `_sv_light_200.png` when `largeFont` is set (200 % font scale, Swedish and light, as the spec's 200 % * frames). The pattern of `:core:design` (M6): content set once, language, theme and font scale switched through a * configuration context between captures. @@ -45,7 +45,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 { diff --git a/android/feature/home/src/test/kotlin/se/hagstedt/kvitt/feature/home/ScreenSnapshots.kt b/android/feature/home/src/test/kotlin/se/hagstedt/kvitt/feature/home/ScreenSnapshots.kt index 318ae34..54702f9 100644 --- a/android/feature/home/src/test/kotlin/se/hagstedt/kvitt/feature/home/ScreenSnapshots.kt +++ b/android/feature/home/src/test/kotlin/se/hagstedt/kvitt/feature/home/ScreenSnapshots.kt @@ -30,13 +30,13 @@ import kotlin.time.Instant /** * Full-screen goldens of this module's screens, as M6's component snapshots but for whole screens (dialogs and menus - * included): `src/test/screenshots/__.png`, plus `_sv_light_200.png` at 200 % font - * scale for the long states. The screen is the Galaxy S26 (411 × 891 dp), at xhdpi to keep the goldens small. The + * included): `src/test/screenshots/_.png`, plus `_sv_light_200.png` at 200 % font + * scale for the long states. The screen is the Galaxy S26 (411 × 891 dp), at mdpi (1x) to keep the goldens small (D-098). The * clock is fixed at 17 October 2026 14:02 in Stockholm; the frame clock is advanced by hand so animations and * snackbars render the same every run. */ object ScreenSnapshots { - const val QUALIFIERS = "w411dp-h891dp-xhdpi" + const val QUALIFIERS = "w411dp-h891dp-mdpi" val clock = KvittClock.fixed(Instant.parse("2026-10-17T12:02:00Z"), TimeZone.of("Europe/Stockholm")) private const val SETTLE_MILLIS = 1_000L @@ -46,7 +46,7 @@ object ScreenSnapshots { @OptIn(ExperimentalRoborazziApi::class) fun snap(compose: ComposeContentTestRule, name: String, largeFont: Boolean, 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.mainClock.autoAdvance = false diff --git a/android/feature/onboarding/src/test/kotlin/se/hagstedt/kvitt/feature/onboarding/screenshot/OnboardingScreenshotTest.kt b/android/feature/onboarding/src/test/kotlin/se/hagstedt/kvitt/feature/onboarding/screenshot/OnboardingScreenshotTest.kt index 7f9b45a..b807347 100644 --- a/android/feature/onboarding/src/test/kotlin/se/hagstedt/kvitt/feature/onboarding/screenshot/OnboardingScreenshotTest.kt +++ b/android/feature/onboarding/src/test/kotlin/se/hagstedt/kvitt/feature/onboarding/screenshot/OnboardingScreenshotTest.kt @@ -23,7 +23,7 @@ import org.robolectric.annotation.GraphicsMode @OptIn(ExperimentalCoroutinesApi::class) @RunWith(ParameterizedRobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) -@Config(sdk = [36], qualifiers = "w411dp-h891dp-xxhdpi") +@Config(sdk = [36], qualifiers = "w411dp-h891dp-mdpi") class OnboardingScreenshotTest(private val name: String) { @get:Rule val compose = createComposeRule() diff --git a/android/feature/onboarding/src/test/kotlin/se/hagstedt/kvitt/feature/onboarding/screenshot/ScreenSnapshots.kt b/android/feature/onboarding/src/test/kotlin/se/hagstedt/kvitt/feature/onboarding/screenshot/ScreenSnapshots.kt index a54e53a..af1ca79 100644 --- a/android/feature/onboarding/src/test/kotlin/se/hagstedt/kvitt/feature/onboarding/screenshot/ScreenSnapshots.kt +++ b/android/feature/onboarding/src/test/kotlin/se/hagstedt/kvitt/feature/onboarding/screenshot/ScreenSnapshots.kt @@ -27,7 +27,7 @@ import java.util.Locale import kotlin.time.Instant /** - * Captures a whole screen once per theme and language: `src/test/screenshots/__.png`, plus + * Captures a whole screen in three variants (Swedish light and dark, English light; D-098): `src/test/screenshots/_.png`, plus * `_sv_light_200.png` when `largeFont` is set (200 % font scale, Swedish, light), as `:core:design`'s Snapshots * do for components. The phone is the Galaxy S26 (411 dp wide, SPEC §13.1); the clock is fixed at 17 October 2026 * 14:02 in Stockholm so every render is reproducible. @@ -40,7 +40,7 @@ object ScreenSnapshots { } fun snap(compose: ComposeContentTestRule, name: String, largeFont: Boolean, 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 { diff --git a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/CategoriesScreenshotTest.kt b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/CategoriesScreenshotTest.kt index 9037264..6dc0272 100644 --- a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/CategoriesScreenshotTest.kt +++ b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/CategoriesScreenshotTest.kt @@ -27,7 +27,7 @@ import se.hagstedt.kvitt.model.OnlineResult /** S-15 Categories, list and editor (design-spec S-15 and PLAN-M7f §5). */ @RunWith(ParameterizedRobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) -@Config(sdk = [36], qualifiers = "w411dp-h914dp-xxhdpi") +@Config(sdk = [36], qualifiers = "w411dp-h914dp-mdpi") class CategoriesScreenshotTest(private val state: String) { @get:Rule val compose = createComposeRule() diff --git a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/DevicesInvitesAboutScreenshotTest.kt b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/DevicesInvitesAboutScreenshotTest.kt index a6dd06c..356f33a 100644 --- a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/DevicesInvitesAboutScreenshotTest.kt +++ b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/DevicesInvitesAboutScreenshotTest.kt @@ -28,7 +28,7 @@ import se.hagstedt.kvitt.model.UpdateState /** S-20 Devices, S-21 Invites and S-22 About (design-spec §4 and PLAN-M7f §5). */ @RunWith(ParameterizedRobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) -@Config(sdk = [36], qualifiers = "w411dp-h914dp-xxhdpi") +@Config(sdk = [36], qualifiers = "w411dp-h914dp-mdpi") class DevicesInvitesAboutScreenshotTest(private val state: String) { @get:Rule val compose = createComposeRule() diff --git a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/HubScreenshotTest.kt b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/HubScreenshotTest.kt index cdcdfb3..cd7aad4 100644 --- a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/HubScreenshotTest.kt +++ b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/HubScreenshotTest.kt @@ -19,7 +19,7 @@ import se.hagstedt.kvitt.feature.settings.hub.SettingsHubViewModel /** S-13 Settings hub: every state × sv/en × light/dark (design-spec S-13). */ @RunWith(ParameterizedRobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) -@Config(sdk = [36], qualifiers = "w411dp-h914dp-xxhdpi") +@Config(sdk = [36], qualifiers = "w411dp-h914dp-mdpi") class HubScreenshotTest(private val state: String) { @get:Rule val compose = createComposeRule() diff --git a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/ProfileScreenshotTest.kt b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/ProfileScreenshotTest.kt index 794eecb..89db2cb 100644 --- a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/ProfileScreenshotTest.kt +++ b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/ProfileScreenshotTest.kt @@ -20,7 +20,7 @@ import se.hagstedt.kvitt.model.OnlineResult /** S-14 Profile (design-spec S-14 and PLAN-M7f §5). */ @RunWith(ParameterizedRobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) -@Config(sdk = [36], qualifiers = "w411dp-h914dp-xxhdpi") +@Config(sdk = [36], qualifiers = "w411dp-h914dp-mdpi") class ProfileScreenshotTest(private val state: String) { @get:Rule val compose = createComposeRule() diff --git a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/RecurringScreenshotTest.kt b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/RecurringScreenshotTest.kt index 5c63e3a..a4627c0 100644 --- a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/RecurringScreenshotTest.kt +++ b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/RecurringScreenshotTest.kt @@ -30,7 +30,7 @@ import se.hagstedt.kvitt.model.RecurringTemplate /** S-19 Recurring expenses, list and editor (design-spec S-19 and PLAN-M7f §5). */ @RunWith(ParameterizedRobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) -@Config(sdk = [36], qualifiers = "w411dp-h914dp-xxhdpi") +@Config(sdk = [36], qualifiers = "w411dp-h914dp-mdpi") class RecurringScreenshotTest(private val state: String) { @get:Rule val compose = createComposeRule() diff --git a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/ScreenSnapshots.kt b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/ScreenSnapshots.kt index c6bce24..d679d16 100644 --- a/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/ScreenSnapshots.kt +++ b/android/feature/settings/src/test/kotlin/se/hagstedt/kvitt/feature/settings/screenshot/ScreenSnapshots.kt @@ -39,8 +39,8 @@ import java.util.Locale import kotlin.time.Instant /** - * Whole-screen goldens of `:feature:settings` (M7f), following `:core:design`'s pattern: one capture per language and - * theme, `src/test/screenshots/__.png`. The screen (Robolectric `w411dp-h914dp`, the Galaxy + * Whole-screen goldens of `:feature:settings` (M7f), following `:core:design`'s pattern: three captures (Swedish light and + * dark, English light; D-098), `src/test/screenshots/_.png`. The screen (Robolectric `w411dp-h914dp`, the Galaxy * S26) is captured with its dialogs. Content is set once; language and theme switch through a configuration context. * The clock is 17 October 2026 14:02 Stockholm, as in the fakes' scenarios. */ @@ -56,7 +56,7 @@ object ScreenSnapshots { @OptIn(ExperimentalRoborazziApi::class) fun snap(compose: ComposeContentTestRule, name: String, picture: Boolean = false, prepare: (ComposeContentTestRule) -> Unit = {}, content: @Composable () -> Unit) { - val variants = listOf("sv", "en").flatMap { l -> listOf(false, true).map { Variant(l, it) } } + val variants = listOf(Variant("sv", dark = false), Variant("sv", dark = true), Variant("en", dark = false)) var current by mutableStateOf(variants.first()) compose.setContent { val variant = current diff --git a/android/feature/settle/src/test/kotlin/se/hagstedt/kvitt/feature/settle/screenshot/ScreenSnapshots.kt b/android/feature/settle/src/test/kotlin/se/hagstedt/kvitt/feature/settle/screenshot/ScreenSnapshots.kt index 115f0e4..b46842b 100644 --- a/android/feature/settle/src/test/kotlin/se/hagstedt/kvitt/feature/settle/screenshot/ScreenSnapshots.kt +++ b/android/feature/settle/src/test/kotlin/se/hagstedt/kvitt/feature/settle/screenshot/ScreenSnapshots.kt @@ -39,7 +39,7 @@ import java.util.Locale import kotlin.time.Instant /** - * Captures a whole screen once per theme and language: `src/test/screenshots/__.png`, plus + * Captures a whole screen in three variants (Swedish light and dark, English light; D-098): `src/test/screenshots/_.png`, plus * `_sv_light_200.png` with [largeFont] (200 % font scale, Swedish, light, like the spec's 200 % frames). Pattern * of `:core:design`'s `Snapshots` (M6): content set once, configuration switched between captures. The screen is the * Galaxy S26's 411 dp wide and [height] high; the clock is fixed at 17 October 2026 14:02 in Stockholm. @@ -71,7 +71,7 @@ object ScreenSnapshots { } fun snap(compose: ComposeContentTestRule, name: String, height: Dp = PHONE_HEIGHT, largeFont: Boolean = false, content: @Composable BoxScope.() -> 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 { diff --git a/android/feature/settle/src/test/kotlin/se/hagstedt/kvitt/feature/settle/screenshot/SettleScreenshotTest.kt b/android/feature/settle/src/test/kotlin/se/hagstedt/kvitt/feature/settle/screenshot/SettleScreenshotTest.kt index a786f1b..e1899b1 100644 --- a/android/feature/settle/src/test/kotlin/se/hagstedt/kvitt/feature/settle/screenshot/SettleScreenshotTest.kt +++ b/android/feature/settle/src/test/kotlin/se/hagstedt/kvitt/feature/settle/screenshot/SettleScreenshotTest.kt @@ -84,7 +84,7 @@ private val cases: Map = linkedMapOf( @RunWith(ParameterizedRobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) -@Config(sdk = [36], qualifiers = "w411dp-h2400dp-xxhdpi") +@Config(sdk = [36], qualifiers = "w411dp-h2400dp-mdpi") class SettleScreenshotTest(private val name: String) { @get:Rule val compose = createComposeRule()