From 07ee0d186f9d449566fecbe353ac4c9df92a4c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20G=C3=B6ransson?= Date: Thu, 26 Dec 2024 21:58:36 +0100 Subject: [PATCH] Fix tests --- .../mullvad/mullvadvpn/compose/screen/FilterScreenTest.kt | 8 ++++---- .../mullvad/mullvadvpn/usecase/FilterChipUseCaseTest.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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 7e7c61c9de2e..0ef1ebfbc887 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 @@ -130,7 +130,7 @@ class FilterScreenTest { RelayFilterUiState( providerToOwnerships = DUMMY_RELAY_ALL_PROVIDERS, selectedOwnership = Constraint.Any, - selectedProviders = Constraint.Only(listOf(ProviderId("31173"))), + selectedProviders = Constraint.Only(setOf(ProviderId("31173"))), ), onApplyClick = mockClickListener, ) @@ -146,8 +146,8 @@ class FilterScreenTest { state = RelayFilterUiState( providerToOwnerships = DUMMY_RELAY_ALL_PROVIDERS, - selectedOwnership = null, - selectedProviders = listOf(ProviderId("1RemovedProvider")), + selectedOwnership = Constraint.Any, + selectedProviders = Constraint.Only(setOf(ProviderId("1RemovedProvider"))), ) ) @@ -179,6 +179,6 @@ class FilterScreenTest { ProviderId("xtom") to setOf(Ownership.Rented), ) - private val DUMMY_SELECTED_PROVIDERS = DUMMY_RELAY_ALL_PROVIDERS.keys.toList().dropLast(3) + private val DUMMY_SELECTED_PROVIDERS = DUMMY_RELAY_ALL_PROVIDERS.keys.drop(3).toSet() } } diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/usecase/FilterChipUseCaseTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/usecase/FilterChipUseCaseTest.kt index 32921b4ab0c3..ad1bc41a1bc3 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/usecase/FilterChipUseCaseTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/usecase/FilterChipUseCaseTest.kt @@ -189,7 +189,7 @@ class FilterChipUseCaseTest { fun `ensure that a selected provider that is not in the provider list is still counted`() = runTest { // Arrange - val expectedProviders = Providers(providers = setOf(ProviderId("1"))) + val expectedProviders = setOf(ProviderId("1")) val expectedOwnership = Ownership.MullvadOwned selectedProviders.value = Constraint.Only(expectedProviders) selectedOwnership.value = Constraint.Only(expectedOwnership)