From 97686cbd8f35f63aad83cf38dc5fc1cfa48aeb43 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Wed, 21 Feb 2024 19:40:35 +0900 Subject: [PATCH 01/17] Add if state to prevent blank query. --- .../apps/nowinandroid/feature/search/SearchViewModel.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt index 6dd93ceb63..5c3d7b56e9 100644 --- a/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt +++ b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt @@ -103,10 +103,12 @@ class SearchViewModel @Inject constructor( * search query in the search text field, defining this method. */ fun onSearchTriggered(query: String) { - viewModelScope.launch { - recentSearchRepository.insertOrReplaceRecentSearch(searchQuery = query) + if (query.isNotBlank()) { + viewModelScope.launch { + recentSearchRepository.insertOrReplaceRecentSearch(searchQuery = query) + } + analyticsHelper.logEventSearchTriggered(query = query) } - analyticsHelper.logEventSearchTriggered(query = query) } fun clearRecentSearches() { From aa42b488a2ed7cb9f19e277fa584053de41d956d Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Wed, 21 Feb 2024 20:29:27 +0900 Subject: [PATCH 02/17] Create test emptySearchText_NotAddToRecentSearches - For empty query not add in recent query list. --- .../feature/search/SearchViewModelTest.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index da0d5654e8..70492aa92d 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -33,6 +33,7 @@ import com.google.samples.apps.nowinandroid.feature.search.SearchResultUiState.E import com.google.samples.apps.nowinandroid.feature.search.SearchResultUiState.Loading import com.google.samples.apps.nowinandroid.feature.search.SearchResultUiState.SearchNotReady import kotlinx.coroutines.flow.collect +import kotlinx.coroutines.flow.first import kotlinx.coroutines.launch import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.runTest @@ -128,4 +129,15 @@ class SearchViewModelTest { collectJob.cancel() } + + @Test + fun emptySearchText_NotAddToRecentSearches() = runTest { + viewModel.onSearchTriggered("") + + val recentSearchQueriesStream = getRecentQueryUseCase() + val recentSearchQueries = recentSearchQueriesStream.first() + val recentSearchQuery = recentSearchQueries.firstOrNull() + + assertEquals(null, recentSearchQuery) + } } From d1582a011455cff3d3e9008df3a955569b33baa3 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Wed, 21 Feb 2024 21:15:57 +0900 Subject: [PATCH 03/17] Apply early return. --- .../apps/nowinandroid/feature/search/SearchViewModel.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt index 5c3d7b56e9..dbf3c6ee15 100644 --- a/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt +++ b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt @@ -103,12 +103,11 @@ class SearchViewModel @Inject constructor( * search query in the search text field, defining this method. */ fun onSearchTriggered(query: String) { - if (query.isNotBlank()) { - viewModelScope.launch { - recentSearchRepository.insertOrReplaceRecentSearch(searchQuery = query) - } - analyticsHelper.logEventSearchTriggered(query = query) + if (query.isBlank()) return + viewModelScope.launch { + recentSearchRepository.insertOrReplaceRecentSearch(searchQuery = query) } + analyticsHelper.logEventSearchTriggered(query = query) } fun clearRecentSearches() { From cd6224c3c3d6592463f980975d976b8f8c2062c2 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Wed, 21 Feb 2024 21:21:22 +0900 Subject: [PATCH 04/17] assertEquals to assertNull. Co-authored-by: Simon Marquis --- .../apps/nowinandroid/feature/search/SearchViewModelTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index 70492aa92d..df60b6be4c 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -138,6 +138,6 @@ class SearchViewModelTest { val recentSearchQueries = recentSearchQueriesStream.first() val recentSearchQuery = recentSearchQueries.firstOrNull() - assertEquals(null, recentSearchQuery) + assertNull(recentSearchQuery) } } From 9fb4c6a64b9759241e5b396690cb04f9f12e1faa Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Wed, 21 Feb 2024 21:22:30 +0900 Subject: [PATCH 05/17] Import org.junit.Assert.assertNull --- .../apps/nowinandroid/feature/search/SearchViewModelTest.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index df60b6be4c..e68ea8d675 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -37,6 +37,7 @@ import kotlinx.coroutines.flow.first import kotlinx.coroutines.launch import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.runTest +import org.junit.Assert.assertNull import org.junit.Before import org.junit.Rule import org.junit.Test From ad2c78231764c6cd945a772877fdb5efe05c5ed8 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Wed, 21 Feb 2024 21:43:05 +0900 Subject: [PATCH 06/17] Change org.junit.Assert.assertNull to kotlin.test.assertNull. Change-Id: I60083b0b9a1dcaed84d957b49c91e5163d5659d6 --- .../apps/nowinandroid/feature/search/SearchViewModelTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index e68ea8d675..2aeb821236 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -37,12 +37,12 @@ import kotlinx.coroutines.flow.first import kotlinx.coroutines.launch import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.runTest -import org.junit.Assert.assertNull import org.junit.Before import org.junit.Rule import org.junit.Test import kotlin.test.assertEquals import kotlin.test.assertIs +import kotlin.test.assertNull /** * To learn more about how this test handles Flows created with stateIn, see From 1976c4cf3cafce402e3dea83c4b5a00316ed7752 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Thu, 22 Feb 2024 11:06:22 +0900 Subject: [PATCH 07/17] Add 'or' to prevent search when query is blank. Change-Id: If498de05889d6d5946b1bbb1d1c10cb311bb9b52 --- .../apps/nowinandroid/feature/search/SearchViewModel.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt index dbf3c6ee15..7a62a62320 100644 --- a/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt +++ b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt @@ -57,7 +57,9 @@ class SearchViewModel @Inject constructor( flowOf(SearchResultUiState.SearchNotReady) } else { searchQuery.flatMapLatest { query -> - if (query.length < SEARCH_QUERY_MIN_LENGTH) { + if ((query.length < SEARCH_QUERY_MIN_LENGTH) + .or(query.isBlank()) + ) { flowOf(SearchResultUiState.EmptyQuery) } else { getSearchContentsUseCase(query) From b0e121263e83a31197ad0729cbddbc9460b4803d Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Thu, 22 Feb 2024 11:07:24 +0900 Subject: [PATCH 08/17] Create stateIsEmptyQuery_withThreeWhiteSpacesSearchQuery test. Change-Id: I6d6e8f9fe988ca83fae484e4f2338ad6fe58b676 --- .../feature/search/SearchViewModelTest.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index 2aeb821236..607391c775 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -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(viewModel.searchResultUiState.value) + + collectJob.cancel() + } } From 983c6fec14e8b8b51e5f6256d6401f3fe31d37d3 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Thu, 22 Feb 2024 11:22:55 +0900 Subject: [PATCH 09/17] Add UI logic to prevent blank text search in SearchScreen. - Early return to do not call onSearchExplicitlyTriggered() Change-Id: I28db284eac9059fb6f48dd718721a1fc5fdb8f7a --- .../samples/apps/nowinandroid/feature/search/SearchScreen.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreen.kt b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreen.kt index d05f02b222..a231265765 100644 --- a/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreen.kt +++ b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreen.kt @@ -526,6 +526,7 @@ private fun SearchTextField( .focusRequester(focusRequester) .onKeyEvent { if (it.key == Key.Enter) { + if (searchQuery.isBlank()) return@onKeyEvent false onSearchExplicitlyTriggered() true } else { @@ -540,6 +541,7 @@ private fun SearchTextField( ), keyboardActions = KeyboardActions( onSearch = { + if (searchQuery.isBlank()) return@KeyboardActions onSearchExplicitlyTriggered() }, ), From 324b693289047219a2cf2fd52a00515725ff8984 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Fri, 23 Feb 2024 09:46:46 +0900 Subject: [PATCH 10/17] Apply trim at query to remove whitespace. Change-Id: Id349af4bb1af3d0f1c3973e6fb9e6f3e7b924d9b --- .../apps/nowinandroid/feature/search/SearchViewModel.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt index 7a62a62320..8b8869fa82 100644 --- a/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt +++ b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt @@ -57,9 +57,7 @@ class SearchViewModel @Inject constructor( flowOf(SearchResultUiState.SearchNotReady) } else { searchQuery.flatMapLatest { query -> - if ((query.length < SEARCH_QUERY_MIN_LENGTH) - .or(query.isBlank()) - ) { + if (query.trim().length < SEARCH_QUERY_MIN_LENGTH) { flowOf(SearchResultUiState.EmptyQuery) } else { getSearchContentsUseCase(query) From f1a55cced35d50fc9011e2b2bed05ebdf55cf921 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Fri, 23 Feb 2024 09:56:36 +0900 Subject: [PATCH 11/17] Create test stateIsEmptyQuery_withThreeWhiteSpacesAndOneLetterSearchQuery Change-Id: Iee59f6085e4045b2e3c532f78804926290b6c6c5 --- .../feature/search/SearchViewModelTest.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index 607391c775..e6eda10703 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -154,4 +154,17 @@ class SearchViewModelTest { collectJob.cancel() } + + @Test + fun stateIsEmptyQuery_withThreeWhiteSpacesAndOneLetterSearchQuery() = runTest { + searchContentsRepository.addNewsResources(newsResourcesTestData) + searchContentsRepository.addTopics(topicsTestData) + val collectJob = launch(UnconfinedTestDispatcher()) { viewModel.searchResultUiState.collect() } + + viewModel.onSearchQueryChanged(" a") + + assertIs(viewModel.searchResultUiState.value) + + collectJob.cancel() + } } From bc59112b656f9d6d1354e5b2c1ae48df57d7c6fb Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Wed, 6 Mar 2024 08:41:55 +0900 Subject: [PATCH 12/17] Update feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt Change name to emptySearchText_isNotAddedTorecentSearches() Co-authored-by: Don Turner --- .../apps/nowinandroid/feature/search/SearchViewModelTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index e6eda10703..e680c4fa49 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -132,7 +132,7 @@ class SearchViewModelTest { } @Test - fun emptySearchText_NotAddToRecentSearches() = runTest { + fun emptySearchText_isNotAddedToRecentSearches() = runTest { viewModel.onSearchTriggered("") val recentSearchQueriesStream = getRecentQueryUseCase() From 1fd341d2088fe296e61244d24cbf72b663eff032 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Wed, 6 Mar 2024 08:42:43 +0900 Subject: [PATCH 13/17] Change name to searchTextWithThreeSpaces_isEmptyQuery() Co-authored-by: Don Turner --- .../apps/nowinandroid/feature/search/SearchViewModelTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index e680c4fa49..d365959cdb 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -143,7 +143,7 @@ class SearchViewModelTest { } @Test - fun stateIsEmptyQuery_withThreeWhiteSpacesSearchQuery() = runTest { + fun searchTextWithThreeSpaces_isEmptyQuery() = runTest { searchContentsRepository.addNewsResources(newsResourcesTestData) searchContentsRepository.addTopics(topicsTestData) val collectJob = launch(UnconfinedTestDispatcher()) { viewModel.searchResultUiState.collect() } From e4c176598ab11d96802963a0c814c446fc32e16b Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Wed, 6 Mar 2024 08:47:20 +0900 Subject: [PATCH 14/17] Change name to searchTextWithThreeWhiteSpacesAndOneCharacter_isEmptyQuery() Change-Id: I4c82b12e2c9bd4ff480e94061caf257a603e38da --- .../apps/nowinandroid/feature/search/SearchViewModelTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index d365959cdb..b3d9aec7d1 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -156,7 +156,7 @@ class SearchViewModelTest { } @Test - fun stateIsEmptyQuery_withThreeWhiteSpacesAndOneLetterSearchQuery() = runTest { + fun searchTextWithThreeWhiteSpacesAndOneCharacter_isEmptyQuery() = runTest { searchContentsRepository.addNewsResources(newsResourcesTestData) searchContentsRepository.addTopics(topicsTestData) val collectJob = launch(UnconfinedTestDispatcher()) { viewModel.searchResultUiState.collect() } From 39a137ff998a0da753e36fefac396239cd694e58 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Wed, 6 Mar 2024 08:49:30 +0900 Subject: [PATCH 15/17] Revert "Change name to searchTextWithThreeWhiteSpacesAndOneCharacter_isEmptyQuery()" This reverts commit e4c176598ab11d96802963a0c814c446fc32e16b. --- .../apps/nowinandroid/feature/search/SearchViewModelTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index b3d9aec7d1..d365959cdb 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -156,7 +156,7 @@ class SearchViewModelTest { } @Test - fun searchTextWithThreeWhiteSpacesAndOneCharacter_isEmptyQuery() = runTest { + fun stateIsEmptyQuery_withThreeWhiteSpacesAndOneLetterSearchQuery() = runTest { searchContentsRepository.addNewsResources(newsResourcesTestData) searchContentsRepository.addTopics(topicsTestData) val collectJob = launch(UnconfinedTestDispatcher()) { viewModel.searchResultUiState.collect() } From 86645285bf1299fb6f2ee21bf36994462ea36b49 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Wed, 6 Mar 2024 08:52:39 +0900 Subject: [PATCH 16/17] Change name to searchTextWithThreeSpacesAndOneLetter_isEmptyQuery Co-authored-by: Don Turner --- .../apps/nowinandroid/feature/search/SearchViewModelTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index d365959cdb..671b543f59 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -156,7 +156,7 @@ class SearchViewModelTest { } @Test - fun stateIsEmptyQuery_withThreeWhiteSpacesAndOneLetterSearchQuery() = runTest { + fun searchTextWithThreeSpacesAndOneLetter_isEmptyQuery() = runTest { searchContentsRepository.addNewsResources(newsResourcesTestData) searchContentsRepository.addTopics(topicsTestData) val collectJob = launch(UnconfinedTestDispatcher()) { viewModel.searchResultUiState.collect() } From f820cf25fa9fcbd97d024333147d28b041a96780 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Fri, 15 Mar 2024 19:04:03 +0900 Subject: [PATCH 17/17] Add end curly bracket. Change-Id: I7bd113e7b65d646f5321e34a7df2868f6e239cad --- .../apps/nowinandroid/feature/search/SearchViewModelTest.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index c93a9a2a83..52180dfe96 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -168,6 +168,7 @@ class SearchViewModelTest { assertIs(viewModel.searchResultUiState.value) collectJob.cancel() + } @Test fun whenToggleNewsResourceSavedIsCalled_bookmarkStateIsUpdated() = runTest {