diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/FilterScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/FilterScreenTest.kt index e6dac7364be4..ee913a3fa337 100644 --- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/FilterScreenTest.kt +++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/FilterScreenTest.kt @@ -133,7 +133,7 @@ class FilterScreenTest { RelayFilterState( allProviders = listOf(), selectedOwnership = null, - selectedProviders = listOf( Provider("31173", true)), + selectedProviders = listOf(Provider("31173", true)), ), uiCloseAction = MutableSharedFlow(), onSelectedProviders = { _, _ -> }, diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreenTest.kt index 256f89c394ec..7e66bc24d9fa 100644 --- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreenTest.kt +++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreenTest.kt @@ -40,7 +40,7 @@ class SelectLocationScreenTest { SelectLocationScreen( uiState = SelectLocationUiState.Loading, uiCloseAction = MutableSharedFlow(), - enterTransitionEndAction = MutableSharedFlow().asSharedFlow(), + enterTransitionEndAction = MutableSharedFlow().asSharedFlow() ) } @@ -59,10 +59,10 @@ class SelectLocationScreenTest { selectedRelay = null, selectedOwnership = null, selectedProvidersCount = 0, - searchTerm = "", + searchTerm = "" ), uiCloseAction = MutableSharedFlow(), - enterTransitionEndAction = MutableSharedFlow().asSharedFlow(), + enterTransitionEndAction = MutableSharedFlow().asSharedFlow() ) } @@ -99,10 +99,10 @@ class SelectLocationScreenTest { selectedRelay = updatedDummyList[0].cities[0].relays[0], selectedOwnership = null, selectedProvidersCount = 0, - searchTerm = "", + searchTerm = "" ), uiCloseAction = MutableSharedFlow(), - enterTransitionEndAction = MutableSharedFlow().asSharedFlow(), + enterTransitionEndAction = MutableSharedFlow().asSharedFlow() ) } @@ -129,11 +129,11 @@ class SelectLocationScreenTest { selectedRelay = null, selectedOwnership = null, selectedProvidersCount = 0, - searchTerm = "", + searchTerm = "" ), uiCloseAction = MutableSharedFlow(), enterTransitionEndAction = MutableSharedFlow().asSharedFlow(), - onSearchTermInput = mockedSearchTermInput, + onSearchTermInput = mockedSearchTermInput ) } val mockSearchString = "SEARCH" @@ -158,11 +158,11 @@ class SelectLocationScreenTest { selectedRelay = null, selectedOwnership = null, selectedProvidersCount = 0, - searchTerm = mockSearchString, + searchTerm = mockSearchString ), uiCloseAction = MutableSharedFlow(), enterTransitionEndAction = MutableSharedFlow().asSharedFlow(), - onSearchTermInput = mockedSearchTermInput, + onSearchTermInput = mockedSearchTermInput ) } @@ -180,7 +180,7 @@ class SelectLocationScreenTest { active = true, endpointData = RelayEndpointData.Wireguard(WireguardRelayEndpointData), owned = true, - provider = "PROVIDER", + provider = "PROVIDER" ) private val DUMMY_RELAY_2 = net.mullvad.mullvadvpn.model.Relay( @@ -188,7 +188,7 @@ class SelectLocationScreenTest { active = true, endpointData = RelayEndpointData.Wireguard(WireguardRelayEndpointData), owned = true, - provider = "PROVIDER", + provider = "PROVIDER" ) private val DUMMY_RELAY_CITY_1 = RelayListCity("Relay City 1", "RCi1", arrayListOf(DUMMY_RELAY_1)) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt index 569a2983c15e..f5e24dacf187 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt @@ -182,7 +182,7 @@ open class MainActivity : FragmentActivity() { R.anim.do_nothing, R.anim.fragment_exit_to_right ) - replace(R.id.select_location_fragment, FilterFragment()) + replace(R.id.main_fragment, FilterFragment()) addToBackStack(null) commitAllowingStateLoss() } 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 0558f3bd9143..bde7d6c77096 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 @@ -7,6 +7,8 @@ import io.mockk.mockk import io.mockk.mockkStatic import io.mockk.unmockkAll import io.mockk.verify +import kotlin.test.assertEquals +import kotlin.test.assertIs import kotlinx.coroutines.cancel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.test.runTest @@ -31,8 +33,6 @@ import org.junit.After import org.junit.Before import org.junit.Rule import org.junit.Test -import kotlin.test.assertEquals -import kotlin.test.assertIs class SelectLocationViewModelTest { @get:Rule val testCoroutineRule = TestCoroutineRule() @@ -50,8 +50,8 @@ class SelectLocationViewModelTest { fun setup() { every { mockRelayListFilterUseCase.selectedOwnership() } returns selectedOwnership - every { mockRelayListFilterUseCase.selectedProviders()} returns selectedProvider - every { mockRelayListFilterUseCase.availableProviders() } returns allProvider + every { mockRelayListFilterUseCase.selectedProviders() } returns selectedProvider + every { mockRelayListFilterUseCase.availableProviders() } returns allProvider every { mockRelayListUseCase.relayListWithSelection() } returns relayListWithSelectionFlow mockkStatic(SERVICE_CONNECTION_MANAGER_EXTENSIONS) diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/filterViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/filterViewModelTest.kt index 192e74abf01f..7e3fbffcf442 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/filterViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/filterViewModelTest.kt @@ -6,6 +6,7 @@ import io.mockk.coVerify import io.mockk.every import io.mockk.mockk import io.mockk.unmockkAll +import kotlin.test.assertEquals import kotlinx.coroutines.cancel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.flowOf @@ -23,7 +24,6 @@ import org.junit.After import org.junit.Before import org.junit.Rule import org.junit.Test -import kotlin.test.assertEquals class FilterViewModelTest { @get:Rule val testCoroutineRule = TestCoroutineRule() @@ -79,7 +79,7 @@ class FilterViewModelTest { val mockOwnership = Ownership.Rented // Assert viewModel.uiState.test { - assertEquals(awaitItem().selectedOwnership , Ownership.MullvadOwned) + assertEquals(awaitItem().selectedOwnership, Ownership.MullvadOwned) viewModel.setSelectedOwnership(mockOwnership) assertEquals(mockOwnership, awaitItem().selectedOwnership) }