mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-22 02:58:55 +02:00
Remove F-droid warnings
This commit is contained in:
@@ -37,7 +37,6 @@ class GetApplicationRelease(
|
||||
release.version,
|
||||
)
|
||||
return when {
|
||||
isNewVersion && arguments.isThirdParty -> Result.ThirdPartyInstallation
|
||||
isNewVersion -> Result.NewUpdate(release)
|
||||
else -> Result.NoNewUpdate
|
||||
}
|
||||
@@ -75,7 +74,6 @@ class GetApplicationRelease(
|
||||
|
||||
data class Arguments(
|
||||
val isPreview: Boolean,
|
||||
val isThirdParty: Boolean,
|
||||
val commitCount: Int,
|
||||
val versionName: String,
|
||||
val repository: String,
|
||||
@@ -86,6 +84,5 @@ class GetApplicationRelease(
|
||||
data class NewUpdate(val release: Release) : Result
|
||||
data object NoNewUpdate : Result
|
||||
data object OsTooOld : Result
|
||||
data object ThirdPartyInstallation : Result
|
||||
}
|
||||
}
|
||||
|
@@ -30,31 +30,6 @@ class GetApplicationReleaseTest {
|
||||
getApplicationRelease = GetApplicationRelease(releaseService, preferenceStore)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `When has update but is third party expect third party installation`() = runTest {
|
||||
every { preference.get() } returns 0
|
||||
every { preference.set(any()) }.answers { }
|
||||
|
||||
coEvery { releaseService.latest(any()) } returns Release(
|
||||
"v2.0.0",
|
||||
"info",
|
||||
"http://example.com/release_link",
|
||||
listOf("http://example.com/assets"),
|
||||
)
|
||||
|
||||
val result = getApplicationRelease.await(
|
||||
GetApplicationRelease.Arguments(
|
||||
isPreview = false,
|
||||
isThirdParty = true,
|
||||
commitCount = 0,
|
||||
versionName = "v1.0.0",
|
||||
repository = "test",
|
||||
),
|
||||
)
|
||||
|
||||
result shouldBe GetApplicationRelease.Result.ThirdPartyInstallation
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `When has update but is preview expect new update`() = runTest {
|
||||
every { preference.get() } returns 0
|
||||
@@ -72,7 +47,6 @@ class GetApplicationReleaseTest {
|
||||
val result = getApplicationRelease.await(
|
||||
GetApplicationRelease.Arguments(
|
||||
isPreview = true,
|
||||
isThirdParty = false,
|
||||
commitCount = 1000,
|
||||
versionName = "",
|
||||
repository = "test",
|
||||
@@ -101,7 +75,6 @@ class GetApplicationReleaseTest {
|
||||
val result = getApplicationRelease.await(
|
||||
GetApplicationRelease.Arguments(
|
||||
isPreview = false,
|
||||
isThirdParty = false,
|
||||
commitCount = 0,
|
||||
versionName = "v1.0.0",
|
||||
repository = "test",
|
||||
@@ -130,7 +103,6 @@ class GetApplicationReleaseTest {
|
||||
val result = getApplicationRelease.await(
|
||||
GetApplicationRelease.Arguments(
|
||||
isPreview = false,
|
||||
isThirdParty = false,
|
||||
commitCount = 0,
|
||||
versionName = "v2.0.0",
|
||||
repository = "test",
|
||||
@@ -157,7 +129,6 @@ class GetApplicationReleaseTest {
|
||||
val result = getApplicationRelease.await(
|
||||
GetApplicationRelease.Arguments(
|
||||
isPreview = false,
|
||||
isThirdParty = false,
|
||||
commitCount = 0,
|
||||
versionName = "v2.0.0",
|
||||
repository = "test",
|
||||
|
Reference in New Issue
Block a user