diff options
| author | David Göransson <david.goransson@mullvad.net> | 2025-05-15 13:54:08 +0200 |
|---|---|---|
| committer | David Göransson <david.goransson@mullvad.net> | 2025-05-15 13:54:08 +0200 |
| commit | 1957ca9181c3badffc103166c3d4f668694e0345 (patch) | |
| tree | 8d2988cca39fd83fb7ace454b6bca6348facb9d3 /android/app/src/test | |
| parent | 5cad8a58a60dd5b544ef96820a7be965b9a3febd (diff) | |
| parent | 2658a984765bae7d097b530acf92d47aabe52da1 (diff) | |
| download | mullvadvpn-1957ca9181c3badffc103166c3d4f668694e0345.tar.xz mullvadvpn-1957ca9181c3badffc103166c3d4f668694e0345.zip | |
Merge branch 'design-review-changes'
Diffstat (limited to 'android/app/src/test')
3 files changed, 8 insertions, 0 deletions
diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/InAppNotificationControllerTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/InAppNotificationControllerTest.kt index b7be4e574d..f9ee9f3d41 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/InAppNotificationControllerTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/InAppNotificationControllerTest.kt @@ -84,6 +84,7 @@ class InAppNotificationControllerTest { newVersionChangelogNotifications.value = listOf(newVersionChangelog) val errorState: ErrorState = mockk() + every { errorState.cause } returns mockk() val tunnelStateBlocked = InAppNotification.TunnelStateBlocked val tunnelStateError = InAppNotification.TunnelStateError(errorState) tunnelStateNotifications.value = listOf(tunnelStateBlocked, tunnelStateError) diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt index b298270fad..44f46b2778 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt @@ -280,6 +280,7 @@ class ConnectViewModelTest { runTest { // Arrange val mockErrorState: ErrorState = mockk() + every { mockErrorState.cause } returns mockk() val expectedConnectNotificationState = InAppNotification.TunnelStateError(mockErrorState) diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/location/SelectLocationViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/location/SelectLocationViewModelTest.kt index a7ecbe17f9..304b664dc6 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/location/SelectLocationViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/location/SelectLocationViewModelTest.kt @@ -29,11 +29,13 @@ import net.mullvad.mullvadvpn.lib.model.Ownership import net.mullvad.mullvadvpn.lib.model.Providers import net.mullvad.mullvadvpn.lib.model.RelayItem import net.mullvad.mullvadvpn.lib.model.RelayItemId +import net.mullvad.mullvadvpn.lib.model.Settings import net.mullvad.mullvadvpn.lib.model.WireguardConstraints import net.mullvad.mullvadvpn.relaylist.descendants import net.mullvad.mullvadvpn.repository.CustomListsRepository import net.mullvad.mullvadvpn.repository.RelayListFilterRepository import net.mullvad.mullvadvpn.repository.RelayListRepository +import net.mullvad.mullvadvpn.repository.SettingsRepository import net.mullvad.mullvadvpn.repository.WireguardConstraintsRepository import net.mullvad.mullvadvpn.usecase.FilterChip import net.mullvad.mullvadvpn.usecase.FilterChipUseCase @@ -53,6 +55,7 @@ class SelectLocationViewModelTest { private val mockCustomListsRepository: CustomListsRepository = mockk() private val mockWireguardConstraintsRepository: WireguardConstraintsRepository = mockk() private val mockFilterChipUseCase: FilterChipUseCase = mockk() + private val mockSettingsRepository: SettingsRepository = mockk() private lateinit var viewModel: SelectLocationViewModel @@ -60,6 +63,7 @@ class SelectLocationViewModelTest { private val wireguardConstraints = MutableStateFlow<WireguardConstraints>(mockk(relaxed = true)) private val filterChips = MutableStateFlow<List<FilterChip>>(emptyList()) private val relayList = MutableStateFlow<List<RelayItem.Location.Country>>(emptyList()) + private val settings = MutableStateFlow<Settings>(mockk(relaxed = true)) @BeforeEach fun setup() { @@ -69,6 +73,7 @@ class SelectLocationViewModelTest { wireguardConstraints every { mockFilterChipUseCase(any()) } returns filterChips every { mockRelayListRepository.relayList } returns relayList + every { mockSettingsRepository.settingsUpdates } returns settings mockkStatic(RELAY_LIST_EXTENSIONS) mockkStatic(RELAY_ITEM_EXTENSIONS) @@ -81,6 +86,7 @@ class SelectLocationViewModelTest { customListsRepository = mockCustomListsRepository, filterChipUseCase = mockFilterChipUseCase, wireguardConstraintsRepository = mockWireguardConstraintsRepository, + settingsRepository = mockSettingsRepository, ) } |
