File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
android/lib/feature/customlist/impl/src/test/java/net/mullvad/mullvadvpn/feature/customlist/impl Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import net.mullvad.mullvadvpn.lib.model.communication.CustomListActionResultData
3131import net.mullvad.mullvadvpn.lib.model.communication.LocationsChanged
3232import net.mullvad.mullvadvpn.lib.repository.RelayListRepository
3333import net.mullvad.mullvadvpn.lib.ui.component.relaylist.CheckableRelayListItem
34+ import net.mullvad.mullvadvpn.lib.ui.designsystem.Hierarchy
3435import net.mullvad.mullvadvpn.lib.usecase.customlists.CustomListActionUseCase
3536import net.mullvad.mullvadvpn.lib.usecase.customlists.CustomListRelayItemsUseCase
3637import 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 {
You can’t perform that action at this time.
0 commit comments