File tree Expand file tree Collapse file tree
AnkiDroid/src/test/java/com/ichi2/anki Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -878,7 +878,9 @@ class CardBrowserTest : RobolectricTest() {
878878 viewModel.changeCardOrder(SortType .EASE ) // reverse the list
879879
880880 viewModel.setCardsOrNotes(NOTES )
881- searchCards()
881+ runTest{
882+ searchCards()
883+ }
882884
883885 assertThat(
884886 " Card Browser has the new noteSortType field" ,
@@ -1011,7 +1013,9 @@ class CardBrowserTest : RobolectricTest() {
10111013 val cardBrowser = getBrowserWithNotes(3 , true )
10121014
10131015 cardBrowser.viewModel.setCardsOrNotes(CARDS )
1014- cardBrowser.searchCards()
1016+ runTest {
1017+ cardBrowser.searchCards()
1018+ }
10151019
10161020 advanceRobolectricLooper()
10171021 // check if we get both cards of each note
@@ -1681,13 +1685,14 @@ val CardBrowser.columnHeadings
16811685 get() =
16821686 columnHeadingViews.map { it.text.toString() }
16831687
1684- fun CardBrowser.searchCards (search : String? = null) {
1688+ suspend fun CardBrowser.searchCards (search : String? = null) {
16851689 if (search != null ) {
16861690 viewModel.launchSearchForCards(search)
16871691 } else {
16881692 viewModel.launchSearchForCards()
16891693 }
1690- runBlocking { viewModel.searchJob?.join() }
1694+ viewModel.searchJob?.join()
16911695}
16921696
1697+
16931698fun CardBrowser.showFindAndReplaceDialog () = cardBrowserFragment.showFindAndReplaceDialog()
You can’t perform that action at this time.
0 commit comments