Skip to content

Commit

Permalink
Merge branch 'fix-show-relay-list-state-selected-test'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Oct 2, 2023
2 parents bb3737b + dad3c47 commit de70dee
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit de70dee

Please sign in to comment.