mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Fix category search bug (#3080)
* Closes #3027 * Concat category search with search with image title list and default categories * Fixed unit test CategoriesPresenterTest.searchForCategoriesTest * bug fix [search for categories even when the edit text is empty (perform title based search)] * Category items should show the selected item on top
This commit is contained in:
parent
32715d9cce
commit
8cd9bd5524
6 changed files with 89 additions and 10 deletions
|
|
@ -57,7 +57,9 @@ class CategoriesPresenterTest {
|
|||
fun searchForCategoriesTest() {
|
||||
Mockito.`when`(repository?.sortBySimilarity(ArgumentMatchers.anyString())).thenReturn(Comparator<CategoryItem> { _, _ -> 1 })
|
||||
Mockito.`when`(repository?.selectedCategories).thenReturn(categoryItems)
|
||||
Mockito.`when`(repository?.searchAll(ArgumentMatchers.anyString(), ArgumentMatchers.anyList())).thenReturn(Observable.empty())
|
||||
Mockito.`when`(repository?.searchAll(ArgumentMatchers.anyString(), ArgumentMatchers.anyList())).thenReturn(testObservable)
|
||||
Mockito.`when`(repository?.searchCategories(ArgumentMatchers.anyString(), ArgumentMatchers.anyList())).thenReturn(testObservable)
|
||||
Mockito.`when`(repository?.getDefaultCategories(ArgumentMatchers.anyList())).thenReturn(testObservable)
|
||||
categoriesPresenter?.searchForCategories("test")
|
||||
verify(view)?.showProgress(true)
|
||||
verify(view)?.showError(null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue