diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DaitaConfirmationDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DaitaConfirmationDialog.kt index 23dd4dfb6b6a..15b21e70d340 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DaitaConfirmationDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DaitaConfirmationDialog.kt @@ -12,7 +12,6 @@ import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource @@ -34,12 +33,12 @@ import net.mullvad.mullvadvpn.lib.theme.color.AlphaScrollbar @Preview @Composable private fun PreviewDaitaConfirmationDialog() { - AppTheme { DaitaConfirmationDialog(EmptyResultBackNavigator()) } + AppTheme { DaitaConfirmation(EmptyResultBackNavigator()) } } @Destination(style = DestinationStyle.Dialog::class) @Composable -fun DaitaConfirmationDialog(navigator: ResultBackNavigator) { +fun DaitaConfirmation(navigator: ResultBackNavigator) { AlertDialog( onDismissRequest = dropUnlessResumed { navigator.navigateBack(false) }, icon = { diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/SelectLocationViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/SelectLocationViewModelTest.kt index 993190ba2c74..a69d123e2ef2 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/SelectLocationViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/SelectLocationViewModelTest.kt @@ -32,10 +32,12 @@ import net.mullvad.mullvadvpn.lib.model.Provider 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.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.usecase.AvailableProvidersUseCase import net.mullvad.mullvadvpn.usecase.FilteredRelayListUseCase import net.mullvad.mullvadvpn.usecase.customlists.CustomListActionUseCase @@ -58,6 +60,9 @@ class SelectLocationViewModelTest { private val mockCustomListsRepository: CustomListsRepository = mockk() private val mockCustomListsRelayItemUseCase: CustomListsRelayItemUseCase = mockk() + private val mockSettingsRepository: SettingsRepository = mockk() + private val settingsFlow = MutableStateFlow(mockk(relaxed = true)) + private lateinit var viewModel: SelectLocationViewModel private val allProviders = MutableStateFlow>(emptyList()) @@ -79,6 +84,7 @@ class SelectLocationViewModelTest { every { mockFilteredRelayListUseCase() } returns filteredRelayList every { mockFilteredCustomListRelayItemsUseCase() } returns filteredCustomRelayListItems every { mockCustomListsRelayItemUseCase() } returns customListsRelayItem + every { mockSettingsRepository.settingsUpdates } returns settingsFlow mockkStatic(RELAY_LIST_EXTENSIONS) mockkStatic(RELAY_ITEM_EXTENSIONS) @@ -93,6 +99,7 @@ class SelectLocationViewModelTest { relayListRepository = mockRelayListRepository, customListsRepository = mockCustomListsRepository, customListsRelayItemUseCase = mockCustomListsRelayItemUseCase, + settingsRepository = mockSettingsRepository, ) }