Skip to content

Commit 76cfee7

Browse files
committed
Fix unit test
1 parent c68546e commit 76cfee7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

android/lib/feature/customlist/impl/src/test/java/net/mullvad/mullvadvpn/feature/customlist/impl/CustomListLocationsViewModelTest.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import net.mullvad.mullvadvpn.lib.model.communication.CustomListActionResultData
3131
import net.mullvad.mullvadvpn.lib.model.communication.LocationsChanged
3232
import net.mullvad.mullvadvpn.lib.repository.RelayListRepository
3333
import net.mullvad.mullvadvpn.lib.ui.component.relaylist.CheckableRelayListItem
34+
import net.mullvad.mullvadvpn.lib.ui.designsystem.Hierarchy
3435
import net.mullvad.mullvadvpn.lib.usecase.customlists.CustomListActionUseCase
3536
import net.mullvad.mullvadvpn.lib.usecase.customlists.CustomListRelayItemsUseCase
3637
import org.junit.jupiter.api.Assertions.assertEquals
@@ -81,7 +82,7 @@ class CustomListLocationsViewModelTest {
8182
DUMMY_COUNTRIES.map {
8283
CheckableRelayListItem(
8384
item = it,
84-
depth = it.toDepth(),
85+
hierarchy = it.toHierarchy(),
8586
checked = false,
8687
expanded = false,
8788
)
@@ -333,11 +334,11 @@ class CustomListLocationsViewModelTest {
333334
private fun Lce.Content<CustomListLocationsData>.selectedLocations() =
334335
this.value.locations.filter { it.checked }.map { it.item.id }
335336

336-
private fun RelayItem.Location.toDepth() =
337+
private fun RelayItem.Location.toHierarchy() =
337338
when (this) {
338-
is RelayItem.Location.Country -> 0
339-
is RelayItem.Location.City -> 1
340-
is RelayItem.Location.Relay -> 2
339+
is RelayItem.Location.Country -> Hierarchy.Parent
340+
is RelayItem.Location.City -> Hierarchy.Child1
341+
is RelayItem.Location.Relay -> Hierarchy.Child2
341342
}
342343

343344
companion object {

0 commit comments

Comments
 (0)