Skip to content

Commit

Permalink
fix: [ANDROAPP-6315] fix compose test
Browse files Browse the repository at this point in the history
  • Loading branch information
xavimolloy committed Jul 10, 2024
1 parent cc6170d commit 99b7acb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class SearchTETest : BaseTest() {
checkFilterCounter(totalFilterCount)
checkCountAtFilter(enrollmentStatusFilter, filterCount)
clickOnFilter()
waitToDebounce(2000)
checkTEIsAreOpen()
}
}
Expand Down Expand Up @@ -337,8 +338,10 @@ class SearchTETest : BaseTest() {
clickOnOpenSearch()
openNextSearchParameter("First name")
typeOnNextSearchTextParameter(name)
waitToDebounce(2000)
clickOnSearch()
composeTestRule.waitForIdle()

}

filterRobot {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class SearchTEIViewModel(
private val _legacyInteraction = MutableLiveData<LegacyInteraction?>()
val legacyInteraction: LiveData<LegacyInteraction?> = _legacyInteraction

val filterManager: FilterManager = FilterManager.getInstance()

private val _refreshData = MutableLiveData(Unit)
val refreshData: LiveData<Unit> = _refreshData

Expand Down Expand Up @@ -326,20 +328,20 @@ class SearchTEIViewModel(
withContext(dispatchers.io()) {
if (
searching && networkUtils.isOnline() &&
FilterManager.getInstance().stateFilters.isEmpty()
filterManager.stateFilters.isEmpty()
) {
searchRepository.transform(
item,
searchParametersModel.selectedProgram,
false,
FilterManager.getInstance().sortingItem,
filterManager.sortingItem,
)
} else {
searchRepository.transform(
item,
searchParametersModel.selectedProgram,
true,
FilterManager.getInstance().sortingItem,
filterManager.sortingItem,
)
}
}
Expand All @@ -364,7 +366,7 @@ class SearchTEIViewModel(
item,
searchParametersModel.selectedProgram,
true,
FilterManager.getInstance().sortingItem,
filterManager.sortingItem,
)
}
}
Expand All @@ -387,20 +389,20 @@ class SearchTEIViewModel(
withContext(dispatchers.io()) {
if (
searching && networkUtils.isOnline() &&
FilterManager.getInstance().stateFilters.isEmpty()
filterManager.stateFilters.isEmpty()
) {
searchRepository.transform(
item,
searchParametersModel.selectedProgram,
false,
FilterManager.getInstance().sortingItem,
filterManager.sortingItem,
)
} else {
searchRepository.transform(
item,
searchParametersModel.selectedProgram,
true,
FilterManager.getInstance().sortingItem,
filterManager.sortingItem,
)
}
}
Expand Down Expand Up @@ -893,9 +895,9 @@ class SearchTEIViewModel(
/* selectedProgram = */
searchParametersModel.selectedProgram,
/* offlineOnly = */
!(isOnline && FilterManager.getInstance().stateFilters.isEmpty()),
!(isOnline && filterManager.stateFilters.isEmpty()),
/* sortingItem = */
FilterManager.getInstance().sortingItem,
filterManager.sortingItem,
)
}

Expand Down

0 comments on commit 99b7acb

Please sign in to comment.