diff options
| author | David Göransson <david.goransson90@gmail.com> | 2023-10-02 17:18:36 +0200 |
|---|---|---|
| committer | David Göransson <david.goransson90@gmail.com> | 2023-10-02 17:18:36 +0200 |
| commit | dad3c47378b81897869a0181e9ac76a06ee09e0a (patch) | |
| tree | 93032b375884f7dc6cc72e759ab170d9f4ae83a4 | |
| parent | bb3737bd8fa8daadac80de9b77efc38b9a1772ca (diff) | |
| download | mullvadvpn-dad3c47378b81897869a0181e9ac76a06ee09e0a.tar.xz mullvadvpn-dad3c47378b81897869a0181e9ac76a06ee09e0a.zip | |
Fix test
| -rw-r--r-- | android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreenTest.kt | 23 |
1 files changed, 13 insertions, 10 deletions
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 106d960d1f..dd767b0c7a 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 @@ -75,22 +75,25 @@ class SelectLocationScreenTest { @Test fun testShowRelayListStateSelected() { + val updatedDummyList = + DUMMY_RELAY_COUNTRIES.let { + val cities = it[0].cities.toMutableList() + val city = cities.removeAt(0) + cities.add(0, city.copy(expanded = true)) + + val mutableRelayList = it.toMutableList() + mutableRelayList[0] = it[0].copy(expanded = true, cities = cities.toList()) + mutableRelayList + } + // Arrange composeTestRule.setContent { AppTheme { SelectLocationScreen( uiState = SelectLocationUiState.ShowData( - countries = - DUMMY_RELAY_COUNTRIES.let { - val cities = it[0].cities.toMutableList() - val city = cities.removeAt(0) - cities.add(0, city.copy(expanded = true)) - it.toMutableList()[0] = - it[0].copy(expanded = true, cities = cities.toList()) - it - }, - selectedRelay = DUMMY_RELAY_COUNTRIES[0].cities[0].relays[0] + countries = updatedDummyList, + selectedRelay = updatedDummyList[0].cities[0].relays[0] ), uiCloseAction = MutableSharedFlow(), enterTransitionEndAction = MutableSharedFlow<Unit>().asSharedFlow() |
