diff --git a/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/effects/SaveSearchToRecentsTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/effects/SaveSearchToRecentsTest.kt index 18435c3aa..57d2f13b6 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/effects/SaveSearchToRecentsTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/effects/SaveSearchToRecentsTest.kt @@ -23,9 +23,9 @@ import io.mockk.Called import io.mockk.mockk import io.mockk.verify import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.test.TestCoroutineScope +import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.advanceUntilIdle -import kotlinx.coroutines.test.runBlockingTest +import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Test import org.kiwix.kiwixmobile.core.dao.NewRecentSearchDao import org.kiwix.kiwixmobile.core.reader.ZimFileReader @@ -38,7 +38,7 @@ internal class SaveSearchToRecentsTest { private val searchListItem = RecentSearchListItem("", ZimFileReader.CONTENT_PREFIX) private val activity: AppCompatActivity = mockk() - private val testDispatcher = TestCoroutineScope() + private val testDispatcher = TestScope() @Test fun `invoke with null Id does nothing`() { @@ -54,7 +54,7 @@ internal class SaveSearchToRecentsTest { } @Test - fun `invoke with non null Id saves search`() = testDispatcher.runBlockingTest { + fun `invoke with non null Id saves search`() = testDispatcher.runTest { val id = "id" SaveSearchToRecents( newRecentSearchDao,