Create stateIsEmptyQuery_withThreeWhiteSpacesSearchQuery test.

Change-Id: I6d6e8f9fe988ca83fae484e4f2338ad6fe58b676
pull/1223/head
Jaehwa Noh 10 months ago
parent 1976c4cf3c
commit b0e121263e

@ -141,4 +141,17 @@ class SearchViewModelTest {
assertNull(recentSearchQuery)
}
@Test
fun stateIsEmptyQuery_withThreeWhiteSpacesSearchQuery() = runTest {
searchContentsRepository.addNewsResources(newsResourcesTestData)
searchContentsRepository.addTopics(topicsTestData)
val collectJob = launch(UnconfinedTestDispatcher()) { viewModel.searchResultUiState.collect() }
viewModel.onSearchQueryChanged(" ")
assertIs<EmptyQuery>(viewModel.searchResultUiState.value)
collectJob.cancel()
}
}

Loading…
Cancel
Save