fix: recognize stable APK releases as newer than release candidates (#1184)

This commit is contained in:
M57 authored and GitHub committed 2026-09-17 22:00:12 +03:00
1 parent e78dd6bfff
commit c2cb08a563
5 files changed
+196 -18

No files matched your search

@@ -166,6 +166,21 @@ class AppUpdateViewModelTest {
// ── Manual check ────────────────────────────────────────────────────
@Test
fun checkForUpdate_stableReleasePromptsInstalledRc() =
runTest {
coEvery { checker.fetchLatestRelease() } returns updateInfo(tag = "v1.25")
val vm = AppUpdateViewModel(app, checker, "1.25.rc.1", testDispatcher)
advanceUntilIdle()
vm.checkForUpdate()
advanceUntilIdle()
assertTrue(vm.state.value is AppUpdateState.UpdateAvailable)
assertEquals("v1.25", (vm.state.value as AppUpdateState.UpdateAvailable).latestTag)
assertEquals(vm.state.value, AppUpdateCache.state.value)
}
@Test
fun checkForUpdate_upToDateWhenSameVersion() =
runTest {