Skip to content

Commit

Permalink
Merge pull request #66 from azrael8576/refactor/clean-code
Browse files Browse the repository at this point in the history
refactor: All Pair usages for enhanced readability and clarity
  • Loading branch information
azrael8576 authored Dec 30, 2023
2 parents 9f28518 + 5401037 commit 54c26d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ internal open class ScheduleScreenRobot(
)
}
private val weekDateText by lazy {
val (weekStart, weekEnd) = scheduleViewState.weekDateText

composeTestRule.onNodeWithContentDescription(
weekDateDescription.format(scheduleViewState.weekDateText.first, scheduleViewState.weekDateText.second),
weekDateDescription.format(weekStart, weekEnd),
useUnmergedTree = true,
)
}
Expand Down Expand Up @@ -233,6 +235,7 @@ internal open class ScheduleScreenRobot(
fun verifyScheduleTopAppBarDisplayed() {
scheduleTopAppBar.assertExists().assertIsDisplayed()
}

fun verifyScheduleToolbarDisplayed() {
scheduleToolbar.assertExists().assertIsDisplayed()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,12 @@ fun WeekActionBar(
)
}

val weekDate = uiStates.weekDateText
val (weekStart, weekEnd) = uiStates.weekDateText
val weekDataDescription = stringResource(R.string.content_description_week_date).format(
weekDate.first,
weekDate.second,
weekStart,
weekEnd,
)
val weekDateText = "${weekDate.first} - ${weekDate.second}"
val weekDateText = "$weekStart - $weekEnd"
TextButton(
modifier = Modifier
.weight(1f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ class ScheduleViewModel @Inject constructor(
}

is ScheduleViewAction.SelectedTab -> {
onTabSelected(action.date.first, action.date.second)
val (position, data) = action.date
onTabSelected(position, data)
}

ScheduleViewAction.ListScrolled -> {
Expand Down

0 comments on commit 54c26d9

Please sign in to comment.