diff options
Diffstat (limited to 'android/app/src')
3 files changed, 10 insertions, 5 deletions
diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceRevokedViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceRevokedViewModelTest.kt index 32cce31136..fa46aff444 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceRevokedViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceRevokedViewModelTest.kt @@ -13,7 +13,7 @@ import io.mockk.verify import io.mockk.verifyOrder import junit.framework.Assert.assertEquals import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.test.TestCoroutineDispatcher +import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.runBlockingTest import net.mullvad.mullvadvpn.compose.state.DeviceRevokedUiState import net.mullvad.mullvadvpn.model.TunnelState @@ -48,7 +48,7 @@ class DeviceRevokedViewModelTest { DeviceRevokedViewModel( mockedServiceConnectionManager, mockedAccountRepository, - TestCoroutineDispatcher() + UnconfinedTestDispatcher() ) } diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/LoginViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/LoginViewModelTest.kt index 6938c4092c..4ba80511c6 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/LoginViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/LoginViewModelTest.kt @@ -11,7 +11,7 @@ import junit.framework.Assert.assertEquals import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.test.TestCoroutineDispatcher +import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.runBlockingTest import kotlinx.coroutines.test.setMain import net.mullvad.mullvadvpn.lib.ipc.Event @@ -45,7 +45,7 @@ class LoginViewModelTest { @Before fun setup() { - Dispatchers.setMain(TestCoroutineDispatcher()) + Dispatchers.setMain(UnconfinedTestDispatcher()) MockKAnnotations.init(this, relaxUnitFun = true) every { mockedAccountRepository.accountCreationEvents } returns accountCreationTestEvents @@ -59,7 +59,7 @@ class LoginViewModelTest { LoginViewModel( mockedAccountRepository, mockedDeviceRepository, - TestCoroutineDispatcher() + UnconfinedTestDispatcher() ) } diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/SettingsViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/SettingsViewModelTest.kt index 0d87ed9311..a858913b31 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/SettingsViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/SettingsViewModelTest.kt @@ -89,9 +89,14 @@ class SettingsViewModelTest { isOutdated = false, isSupported = true ) + every { mockAppVersionInfoCache.version } returns "1.0" + every { mockAppVersionInfoCache.isSupported } returns true + every { mockAppVersionInfoCache.isOutdated } returns false // Act, Assert viewModel.uiState.test { + awaitItem() // Wait for initial value + serviceConnectionState.value = ServiceConnectionState.ConnectedReady(mockServiceConnectionContainer) versionInfo.value = versionInfoTestItem |
