File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
feature/topic/src/test/java/com/google/samples/apps/nowinandroid/feature/topic Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import com.google.samples.apps.nowinandroid.core.testing.repository.TestUserData
2727import com.google.samples.apps.nowinandroid.core.testing.util.MainDispatcherRule
2828import com.google.samples.apps.nowinandroid.feature.topic.navigation.TopicDestination
2929import kotlinx.coroutines.flow.collect
30+ import kotlinx.coroutines.flow.combine
3031import kotlinx.coroutines.flow.first
3132import kotlinx.coroutines.launch
3233import kotlinx.coroutines.test.UnconfinedTestDispatcher
@@ -121,8 +122,13 @@ class TopicViewModelTest {
121122 @Test
122123 fun uiStateTopic_whenFollowedIdsSuccessAndTopicSuccessAndNewsIsSuccess_thenAllSuccess () =
123124 runTest {
124- val collectJob = launch(UnconfinedTestDispatcher ()) { viewModel.topicUiState.collect() }
125-
125+ val collectJob = launch(UnconfinedTestDispatcher ()) {
126+ combine(
127+ viewModel.topicUiState,
128+ viewModel.newUiState,
129+ ::Pair
130+ ).collect()
131+ }
126132 topicsRepository.sendTopics(testInputTopics.map { it.topic })
127133 userDataRepository.setFollowedTopicIds(setOf (testInputTopics[1 ].topic.id))
128134 newsRepository.sendNewsResources(sampleNewsResources)
You can’t perform that action at this time.
0 commit comments