Skip to content

Commit 1ae360d

Browse files
committed
Fix tests
1 parent fc71cbb commit 1ae360d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DaitaConfirmationDialog.kt

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import androidx.compose.material3.Icon
1212
import androidx.compose.material3.MaterialTheme
1313
import androidx.compose.material3.Text
1414
import androidx.compose.runtime.Composable
15-
import androidx.compose.runtime.getValue
1615
import androidx.compose.ui.Alignment
1716
import androidx.compose.ui.Modifier
1817
import androidx.compose.ui.res.painterResource
@@ -34,12 +33,12 @@ import net.mullvad.mullvadvpn.lib.theme.color.AlphaScrollbar
3433
@Preview
3534
@Composable
3635
private fun PreviewDaitaConfirmationDialog() {
37-
AppTheme { DaitaConfirmationDialog(EmptyResultBackNavigator()) }
36+
AppTheme { DaitaConfirmation(EmptyResultBackNavigator()) }
3837
}
3938

4039
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
4140
@Composable
42-
fun DaitaConfirmationDialog(navigator: ResultBackNavigator<Boolean>) {
41+
fun DaitaConfirmation(navigator: ResultBackNavigator<Boolean>) {
4342
AlertDialog(
4443
onDismissRequest = dropUnlessResumed { navigator.navigateBack(false) },
4544
icon = {

android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/SelectLocationViewModelTest.kt

+7
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ import net.mullvad.mullvadvpn.lib.model.Provider
3232
import net.mullvad.mullvadvpn.lib.model.Providers
3333
import net.mullvad.mullvadvpn.lib.model.RelayItem
3434
import net.mullvad.mullvadvpn.lib.model.RelayItemId
35+
import net.mullvad.mullvadvpn.lib.model.Settings
3536
import net.mullvad.mullvadvpn.relaylist.descendants
3637
import net.mullvad.mullvadvpn.repository.CustomListsRepository
3738
import net.mullvad.mullvadvpn.repository.RelayListFilterRepository
3839
import net.mullvad.mullvadvpn.repository.RelayListRepository
40+
import net.mullvad.mullvadvpn.repository.SettingsRepository
3941
import net.mullvad.mullvadvpn.usecase.AvailableProvidersUseCase
4042
import net.mullvad.mullvadvpn.usecase.FilteredRelayListUseCase
4143
import net.mullvad.mullvadvpn.usecase.customlists.CustomListActionUseCase
@@ -58,6 +60,9 @@ class SelectLocationViewModelTest {
5860
private val mockCustomListsRepository: CustomListsRepository = mockk()
5961
private val mockCustomListsRelayItemUseCase: CustomListsRelayItemUseCase = mockk()
6062

63+
private val mockSettingsRepository: SettingsRepository = mockk()
64+
private val settingsFlow = MutableStateFlow(mockk<Settings>(relaxed = true))
65+
6166
private lateinit var viewModel: SelectLocationViewModel
6267

6368
private val allProviders = MutableStateFlow<List<Provider>>(emptyList())
@@ -79,6 +84,7 @@ class SelectLocationViewModelTest {
7984
every { mockFilteredRelayListUseCase() } returns filteredRelayList
8085
every { mockFilteredCustomListRelayItemsUseCase() } returns filteredCustomRelayListItems
8186
every { mockCustomListsRelayItemUseCase() } returns customListsRelayItem
87+
every { mockSettingsRepository.settingsUpdates } returns settingsFlow
8288

8389
mockkStatic(RELAY_LIST_EXTENSIONS)
8490
mockkStatic(RELAY_ITEM_EXTENSIONS)
@@ -93,6 +99,7 @@ class SelectLocationViewModelTest {
9399
relayListRepository = mockRelayListRepository,
94100
customListsRepository = mockCustomListsRepository,
95101
customListsRelayItemUseCase = mockCustomListsRelayItemUseCase,
102+
settingsRepository = mockSettingsRepository,
96103
)
97104
}
98105

0 commit comments

Comments
 (0)