fix(android): pin the version in the settings screenshot

The Settings index shows the installed version, read from the package,
so the committed image held 0.5.1 and the 1.0.0 bump failed the
screenshot check. SettingsScreen takes the version as a parameter that
defaults to the package's, and the test passes a fixed one.
This commit is contained in:
nvrl committed 2026-10-03 14:24:32 +02:00
1 parent 7914cf4dc1
commit bedbe0ef52
3 files changed
+6 -3

No files matched your search

@@ -91,6 +91,9 @@ internal fun SettingsScreen(
onRemoveAllOffline: () -> Unit,
padding: PaddingValues,
initialPage: SettingsPage? = null,
// A parameter so the screenshot tests can pin it: read from the package,
// every version bump changed the committed image of this page.
version: String = appVersion(),
) {
val context = LocalContext.current
val settings = remember { SettingsStore(context) }
@@ -145,7 +148,7 @@ internal fun SettingsScreen(
} else {
"Off"
}
SettingsPage.About -> "Version ${appVersion()} · licences"
SettingsPage.About -> "Version $version · licences"
},
)
},
@@ -286,7 +289,7 @@ internal fun SettingsScreen(
SettingsPage.About -> SettingsSubPage(SettingsPage.About, padding, back) {
ListItem(
headlineContent = { Text("Proton Stream") },
supportingContent = { Text("Version ${appVersion()}") },
supportingContent = { Text("Version $version") },
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
)
SettingAction("Licence", "GPL-3.0-or-later. Comes with absolutely no warranty.") {
@@ -139,7 +139,7 @@ class ScreenshotTest {
@Test
fun `the settings page`() = capture("settings-phone") {
SettingsScreen(LIBRARY, { _, _, _, _ -> }, {}, {}, {}, PaddingValues())
SettingsScreen(LIBRARY, { _, _, _, _ -> }, {}, {}, {}, PaddingValues(), version = "1.0.0")
}
@Test
Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 60 KiB