diff --git a/feature-foryou/src/androidTest/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenTest.kt b/feature-foryou/src/androidTest/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenTest.kt index a2e52bdb4..378b05124 100644 --- a/feature-foryou/src/androidTest/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenTest.kt +++ b/feature-foryou/src/androidTest/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenTest.kt @@ -67,8 +67,8 @@ class ForYouScreenTest { windowSizeClass = WindowSizeClass.calculateFromSize( DpSize(maxWidth, maxHeight) ), - interestsSelectionState = ForYouInterestsSelectionState.Loading, - feedState = ForYouFeedState.Loading, + interestsSelectionState = ForYouInterestsSelectionUiState.Loading, + feedState = ForYouFeedUiState.Loading, onAuthorCheckedChanged = { _, _ -> }, onTopicCheckedChanged = { _, _ -> }, saveFollowedTopics = {}, @@ -92,7 +92,8 @@ class ForYouScreenTest { windowSizeClass = WindowSizeClass.calculateFromSize( DpSize(maxWidth, maxHeight) ), - interestsSelectionState = ForYouInterestsSelectionState.WithInterestsSelection( + interestsSelectionState = + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -153,7 +154,7 @@ class ForYouScreenTest { ), ) ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = emptyList() ), onAuthorCheckedChanged = { _, _ -> }, @@ -200,7 +201,8 @@ class ForYouScreenTest { windowSizeClass = WindowSizeClass.calculateFromSize( DpSize(maxWidth, maxHeight) ), - interestsSelectionState = ForYouInterestsSelectionState.WithInterestsSelection( + interestsSelectionState = + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -261,7 +263,7 @@ class ForYouScreenTest { ), ), ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = emptyList() ), onAuthorCheckedChanged = { _, _ -> }, @@ -314,7 +316,8 @@ class ForYouScreenTest { windowSizeClass = WindowSizeClass.calculateFromSize( DpSize(maxWidth, maxHeight) ), - interestsSelectionState = ForYouInterestsSelectionState.WithInterestsSelection( + interestsSelectionState = + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -375,7 +378,7 @@ class ForYouScreenTest { ), ), ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = emptyList() ), onAuthorCheckedChanged = { _, _ -> }, @@ -428,7 +431,8 @@ class ForYouScreenTest { windowSizeClass = WindowSizeClass.calculateFromSize( DpSize(maxWidth, maxHeight) ), - interestsSelectionState = ForYouInterestsSelectionState.WithInterestsSelection( + interestsSelectionState = + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -489,7 +493,7 @@ class ForYouScreenTest { ), ), ), - feedState = ForYouFeedState.Loading, + feedState = ForYouFeedUiState.Loading, onAuthorCheckedChanged = { _, _ -> }, onTopicCheckedChanged = { _, _ -> }, saveFollowedTopics = {}, @@ -523,8 +527,8 @@ class ForYouScreenTest { windowSizeClass = WindowSizeClass.calculateFromSize( DpSize(maxWidth, maxHeight) ), - interestsSelectionState = ForYouInterestsSelectionState.NoInterestsSelection, - feedState = ForYouFeedState.Loading, + interestsSelectionState = ForYouInterestsSelectionUiState.NoInterestsSelection, + feedState = ForYouFeedUiState.Loading, onAuthorCheckedChanged = { _, _ -> }, onTopicCheckedChanged = { _, _ -> }, saveFollowedTopics = {}, @@ -643,8 +647,8 @@ class ForYouScreenTest { ForYouScreen( windowSizeClass = windowSizeClass, - interestsSelectionState = ForYouInterestsSelectionState.NoInterestsSelection, - feedState = ForYouFeedState.Success( + interestsSelectionState = ForYouInterestsSelectionUiState.NoInterestsSelection, + feedState = ForYouFeedUiState.Success( feed = saveableNewsResources ), onAuthorCheckedChanged = { _, _ -> }, @@ -669,7 +673,10 @@ class ForYouScreenTest { ) val firstFeedItem = composeTestRule - .onNodeWithText("Thanks for helping us reach 1M YouTube Subscribers", substring = true) + .onNodeWithText( + "Thanks for helping us reach 1M YouTube Subscribers", + substring = true + ) .assertHasClickAction() .fetchSemanticsNode() diff --git a/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouFeedState.kt b/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouFeedUiState.kt similarity index 91% rename from feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouFeedState.kt rename to feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouFeedUiState.kt index 3d19cc5a3..c6c6c345c 100644 --- a/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouFeedState.kt +++ b/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouFeedUiState.kt @@ -21,11 +21,11 @@ import com.google.samples.apps.nowinandroid.core.model.data.SaveableNewsResource /** * A sealed hierarchy describing the state of the feed on the for you screen. */ -sealed interface ForYouFeedState { +sealed interface ForYouFeedUiState { /** * The feed is still loading. */ - object Loading : ForYouFeedState + object Loading : ForYouFeedUiState /** * The feed is loaded with the given list of news resources. @@ -35,5 +35,5 @@ sealed interface ForYouFeedState { * The list of news resources contained in this [PopulatedFeed]. */ val feed: List - ) : ForYouFeedState + ) : ForYouFeedUiState } diff --git a/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouInterestsSelectionState.kt b/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouInterestsSelectionUiState.kt similarity index 87% rename from feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouInterestsSelectionState.kt rename to feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouInterestsSelectionUiState.kt index bca006d5a..bce65611c 100644 --- a/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouInterestsSelectionState.kt +++ b/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouInterestsSelectionUiState.kt @@ -22,16 +22,16 @@ import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic /** * A sealed hierarchy describing the interests selection state for the for you screen. */ -sealed interface ForYouInterestsSelectionState { +sealed interface ForYouInterestsSelectionUiState { /** * The interests selection state is loading. */ - object Loading : ForYouInterestsSelectionState + object Loading : ForYouInterestsSelectionUiState /** * There is no interests selection state. */ - object NoInterestsSelection : ForYouInterestsSelectionState + object NoInterestsSelection : ForYouInterestsSelectionUiState /** * There is a interests selection state, with the given lists of topics and authors. @@ -39,7 +39,7 @@ sealed interface ForYouInterestsSelectionState { data class WithInterestsSelection( val topics: List, val authors: List - ) : ForYouInterestsSelectionState { + ) : ForYouInterestsSelectionUiState { /** * True if the current in-progress selection can be saved. */ diff --git a/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt b/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt index 2ab82c054..42e798c39 100644 --- a/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt +++ b/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt @@ -122,8 +122,8 @@ fun ForYouRoute( @Composable fun ForYouScreen( windowSizeClass: WindowSizeClass, - interestsSelectionState: ForYouInterestsSelectionState, - feedState: ForYouFeedState, + interestsSelectionState: ForYouInterestsSelectionUiState, + feedState: ForYouFeedUiState, onTopicCheckedChanged: (String, Boolean) -> Unit, onAuthorCheckedChanged: (String, Boolean) -> Unit, saveFollowedTopics: () -> Unit, @@ -182,7 +182,7 @@ fun ForYouScreen( // Avoid showing a second loading wheel if we already are for the interests // selection showLoadingUIIfLoading = - interestsSelectionState !is ForYouInterestsSelectionState.Loading, + interestsSelectionState !is ForYouInterestsSelectionUiState.Loading, numberOfColumns = numberOfColumns, onNewsResourcesCheckedChanged = onNewsResourcesCheckedChanged ) @@ -211,14 +211,14 @@ fun ForYouScreen( * states. */ private fun LazyListScope.InterestsSelection( - interestsSelectionState: ForYouInterestsSelectionState, + interestsSelectionState: ForYouInterestsSelectionUiState, showLoadingUIIfLoading: Boolean, onAuthorCheckedChanged: (String, Boolean) -> Unit, onTopicCheckedChanged: (String, Boolean) -> Unit, saveFollowedTopics: () -> Unit ) { when (interestsSelectionState) { - ForYouInterestsSelectionState.Loading -> { + ForYouInterestsSelectionUiState.Loading -> { if (showLoadingUIIfLoading) { item { LoadingWheel( @@ -230,8 +230,8 @@ private fun LazyListScope.InterestsSelection( } } } - ForYouInterestsSelectionState.NoInterestsSelection -> Unit - is ForYouInterestsSelectionState.WithInterestsSelection -> { + ForYouInterestsSelectionUiState.NoInterestsSelection -> Unit + is ForYouInterestsSelectionUiState.WithInterestsSelection -> { item { Text( text = stringResource(R.string.onboarding_guidance_title), @@ -293,7 +293,7 @@ private fun LazyListScope.InterestsSelection( @Composable private fun TopicSelection( - interestsSelectionState: ForYouInterestsSelectionState.WithInterestsSelection, + interestsSelectionState: ForYouInterestsSelectionUiState.WithInterestsSelection, onTopicCheckedChanged: (String, Boolean) -> Unit, modifier: Modifier = Modifier ) { @@ -407,13 +407,13 @@ fun TopicIcon( * states. */ private fun LazyListScope.Feed( - feedState: ForYouFeedState, + feedState: ForYouFeedUiState, showLoadingUIIfLoading: Boolean, @IntRange(from = 1) numberOfColumns: Int, onNewsResourcesCheckedChanged: (String, Boolean) -> Unit ) { when (feedState) { - ForYouFeedState.Loading -> { + ForYouFeedUiState.Loading -> { if (showLoadingUIIfLoading) { item { LoadingWheel( @@ -425,7 +425,7 @@ private fun LazyListScope.Feed( } } } - is ForYouFeedState.Success -> { + is ForYouFeedUiState.Success -> { items( feedState.feed.chunked(numberOfColumns) ) { saveableNewsResources -> @@ -491,8 +491,8 @@ fun ForYouScreenLoading() { NiaTheme { ForYouScreen( windowSizeClass = WindowSizeClass.calculateFromSize(DpSize(maxWidth, maxHeight)), - interestsSelectionState = ForYouInterestsSelectionState.Loading, - feedState = ForYouFeedState.Loading, + interestsSelectionState = ForYouInterestsSelectionUiState.Loading, + feedState = ForYouFeedUiState.Loading, onTopicCheckedChanged = { _, _ -> }, onAuthorCheckedChanged = { _, _ -> }, saveFollowedTopics = {}, @@ -512,7 +512,7 @@ fun ForYouScreenTopicSelection() { NiaTheme { ForYouScreen( windowSizeClass = WindowSizeClass.calculateFromSize(DpSize(maxWidth, maxHeight)), - interestsSelectionState = ForYouInterestsSelectionState.WithInterestsSelection( + interestsSelectionState = ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -584,7 +584,7 @@ fun ForYouScreenTopicSelection() { ) ) ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = saveableNewsResource, ), onAuthorCheckedChanged = { _, _ -> }, @@ -606,8 +606,8 @@ fun PopulatedFeed() { NiaTheme { ForYouScreen( windowSizeClass = WindowSizeClass.calculateFromSize(DpSize(maxWidth, maxHeight)), - interestsSelectionState = ForYouInterestsSelectionState.NoInterestsSelection, - feedState = ForYouFeedState.Success( + interestsSelectionState = ForYouInterestsSelectionUiState.NoInterestsSelection, + feedState = ForYouFeedUiState.Success( feed = saveableNewsResource ), onTopicCheckedChanged = { _, _ -> }, diff --git a/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.kt b/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.kt index 34ed142b9..f7e36c430 100644 --- a/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.kt +++ b/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.kt @@ -103,7 +103,7 @@ class ForYouViewModel @Inject constructor( mutableStateOf>(emptySet()) } - val feedState: StateFlow = + val feedState: StateFlow = combine( followedInterestsState, snapshotFlow { inProgressTopicSelection }, @@ -114,7 +114,7 @@ class ForYouViewModel @Inject constructor( when (followedInterestsUserState) { // If we don't know the current selection state, emit loading. - Unknown -> flowOf(ForYouFeedState.Loading) + Unknown -> flowOf(ForYouFeedUiState.Loading) // If the user has followed topics, use those followed topics to populate the feed is FollowedInterests -> { newsRepository.getNewsResourcesStream( @@ -126,7 +126,7 @@ class ForYouViewModel @Inject constructor( // on the in-progress interests selections, if there are any. None -> { if (inProgressTopicSelection.isEmpty() && inProgressAuthorSelection.isEmpty()) { - flowOf(ForYouFeedState.Success(emptyList())) + flowOf(ForYouFeedUiState.Success(emptyList())) } else { newsRepository.getNewsResourcesStream( filterTopicIds = inProgressTopicSelection, @@ -143,10 +143,10 @@ class ForYouViewModel @Inject constructor( .stateIn( scope = viewModelScope, started = SharingStarted.WhileSubscribed(5_000), - initialValue = ForYouFeedState.Loading + initialValue = ForYouFeedUiState.Loading ) - val interestsSelectionState: StateFlow = + val interestsSelectionState: StateFlow = combine( followedInterestsState, topicsRepository.getTopicsStream(), @@ -157,8 +157,8 @@ class ForYouViewModel @Inject constructor( inProgressAuthorSelection -> when (followedInterestsUserState) { - Unknown -> ForYouInterestsSelectionState.Loading - is FollowedInterests -> ForYouInterestsSelectionState.NoInterestsSelection + Unknown -> ForYouInterestsSelectionUiState.Loading + is FollowedInterests -> ForYouInterestsSelectionUiState.NoInterestsSelection None -> { val topics = availableTopics.map { topic -> FollowableTopic( @@ -174,9 +174,9 @@ class ForYouViewModel @Inject constructor( } if (topics.isEmpty() && authors.isEmpty()) { - ForYouInterestsSelectionState.Loading + ForYouInterestsSelectionUiState.Loading } else { - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = topics, authors = authors ) @@ -187,7 +187,7 @@ class ForYouViewModel @Inject constructor( .stateIn( scope = viewModelScope, started = SharingStarted.WhileSubscribed(5_000), - initialValue = ForYouInterestsSelectionState.Loading + initialValue = ForYouInterestsSelectionUiState.Loading ) fun updateTopicSelection(topicId: String, isChecked: Boolean) { @@ -245,7 +245,7 @@ class ForYouViewModel @Inject constructor( private fun Flow>.mapToFeedState( savedNewsResources: Set -): Flow = +): Flow = filterNot { it.isEmpty() } .map { newsResources -> newsResources.map { newsResource -> @@ -255,5 +255,5 @@ private fun Flow>.mapToFeedState( ) } } - .map, ForYouFeedState>(ForYouFeedState::Success) - .onStart { emit(ForYouFeedState.Loading) } + .map, ForYouFeedUiState>(ForYouFeedUiState::Success) + .onStart { emit(ForYouFeedUiState.Loading) } diff --git a/feature-foryou/src/test/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModelTest.kt b/feature-foryou/src/test/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModelTest.kt index 87412f1f3..dffe9c40b 100644 --- a/feature-foryou/src/test/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModelTest.kt +++ b/feature-foryou/src/test/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModelTest.kt @@ -58,12 +58,12 @@ class ForYouViewModelTest { } /** - * A pairing of [ForYouInterestsSelectionState] and [ForYouFeedState] for ease of testing + * A pairing of [ForYouInterestsSelectionUiState] and [ForYouFeedUiState] for ease of testing * state updates as a single flow. */ private data class ForYouUiState( - val interestsSelectionState: ForYouInterestsSelectionState, - val feedState: ForYouFeedState, + val interestsSelectionState: ForYouInterestsSelectionUiState, + val feedState: ForYouFeedUiState, ) private val ForYouViewModel.uiState @@ -79,8 +79,8 @@ class ForYouViewModelTest { viewModel.uiState.test { assertEquals( ForYouUiState( - ForYouInterestsSelectionState.Loading, - ForYouFeedState.Loading + ForYouInterestsSelectionUiState.Loading, + ForYouFeedUiState.Loading ), awaitItem() ) @@ -93,8 +93,8 @@ class ForYouViewModelTest { viewModel.uiState.test { assertEquals( ForYouUiState( - ForYouInterestsSelectionState.Loading, - ForYouFeedState.Loading + ForYouInterestsSelectionUiState.Loading, + ForYouFeedUiState.Loading ), awaitItem() ) @@ -109,8 +109,8 @@ class ForYouViewModelTest { viewModel.uiState.test { assertEquals( ForYouUiState( - ForYouInterestsSelectionState.Loading, - ForYouFeedState.Loading + ForYouInterestsSelectionUiState.Loading, + ForYouFeedUiState.Loading ), awaitItem() ) @@ -125,8 +125,8 @@ class ForYouViewModelTest { viewModel.uiState.test { assertEquals( ForYouUiState( - ForYouInterestsSelectionState.Loading, - ForYouFeedState.Loading + ForYouInterestsSelectionUiState.Loading, + ForYouFeedUiState.Loading ), awaitItem() ) @@ -141,8 +141,8 @@ class ForYouViewModelTest { viewModel.uiState.test { assertEquals( ForYouUiState( - ForYouInterestsSelectionState.Loading, - ForYouFeedState.Loading + ForYouInterestsSelectionUiState.Loading, + ForYouFeedUiState.Loading ), awaitItem() ) @@ -166,7 +166,7 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -238,7 +238,7 @@ class ForYouViewModelTest { ) ), ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = emptyList() ) ), @@ -263,7 +263,7 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -335,7 +335,7 @@ class ForYouViewModelTest { ) ), ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = emptyList() ) ), @@ -359,8 +359,8 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.NoInterestsSelection, - feedState = ForYouFeedState.Loading + ForYouInterestsSelectionUiState.NoInterestsSelection, + feedState = ForYouFeedUiState.Loading ), awaitItem() ) @@ -370,8 +370,8 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.NoInterestsSelection, - feedState = ForYouFeedState.Success( + ForYouInterestsSelectionUiState.NoInterestsSelection, + feedState = ForYouFeedUiState.Success( feed = sampleNewsResources.map { SaveableNewsResource( newsResource = it, @@ -400,8 +400,8 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.NoInterestsSelection, - feedState = ForYouFeedState.Loading + ForYouInterestsSelectionUiState.NoInterestsSelection, + feedState = ForYouFeedUiState.Loading ), awaitItem() ) @@ -411,8 +411,8 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.NoInterestsSelection, - feedState = ForYouFeedState.Success( + ForYouInterestsSelectionUiState.NoInterestsSelection, + feedState = ForYouFeedUiState.Success( feed = sampleNewsResources.map { SaveableNewsResource( newsResource = it, @@ -445,7 +445,7 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -517,7 +517,7 @@ class ForYouViewModelTest { ) ), ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = emptyList(), ) ), @@ -526,7 +526,7 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -598,14 +598,14 @@ class ForYouViewModelTest { ) ), ), - feedState = ForYouFeedState.Loading + feedState = ForYouFeedUiState.Loading ), awaitItem() ) assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -677,7 +677,7 @@ class ForYouViewModelTest { ) ), ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = listOf( SaveableNewsResource( newsResource = sampleNewsResources[1], @@ -714,7 +714,7 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -786,7 +786,7 @@ class ForYouViewModelTest { ) ), ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = emptyList(), ) ), @@ -795,7 +795,7 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -867,14 +867,14 @@ class ForYouViewModelTest { ) ), ), - feedState = ForYouFeedState.Loading + feedState = ForYouFeedUiState.Loading ), awaitItem() ) assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -946,7 +946,7 @@ class ForYouViewModelTest { ) ), ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = listOf( SaveableNewsResource( newsResource = sampleNewsResources[1], @@ -981,7 +981,7 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -1053,7 +1053,7 @@ class ForYouViewModelTest { ) ), ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = emptyList() ) ), @@ -1079,7 +1079,7 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -1151,7 +1151,7 @@ class ForYouViewModelTest { ) ), ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = emptyList() ) ), @@ -1181,8 +1181,8 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.NoInterestsSelection, - feedState = ForYouFeedState.Success( + ForYouInterestsSelectionUiState.NoInterestsSelection, + feedState = ForYouFeedUiState.Success( feed = listOf( SaveableNewsResource( newsResource = sampleNewsResources[1], @@ -1223,8 +1223,8 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.NoInterestsSelection, - feedState = ForYouFeedState.Success( + ForYouInterestsSelectionUiState.NoInterestsSelection, + feedState = ForYouFeedUiState.Success( feed = listOf( SaveableNewsResource( newsResource = sampleNewsResources[0], @@ -1262,8 +1262,8 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.NoInterestsSelection, - feedState = ForYouFeedState.Success( + ForYouInterestsSelectionUiState.NoInterestsSelection, + feedState = ForYouFeedUiState.Success( feed = listOf( SaveableNewsResource( newsResource = sampleNewsResources[1], @@ -1305,7 +1305,7 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -1377,7 +1377,7 @@ class ForYouViewModelTest { ) ) ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = emptyList() ) ), @@ -1409,7 +1409,7 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.WithInterestsSelection( + ForYouInterestsSelectionUiState.WithInterestsSelection( topics = listOf( FollowableTopic( topic = Topic( @@ -1481,7 +1481,7 @@ class ForYouViewModelTest { ) ) ), - feedState = ForYouFeedState.Success( + feedState = ForYouFeedUiState.Success( feed = emptyList() ) ), @@ -1506,8 +1506,8 @@ class ForYouViewModelTest { assertEquals( ForYouUiState( interestsSelectionState = - ForYouInterestsSelectionState.NoInterestsSelection, - feedState = ForYouFeedState.Success( + ForYouInterestsSelectionUiState.NoInterestsSelection, + feedState = ForYouFeedUiState.Success( feed = listOf( SaveableNewsResource( newsResource = sampleNewsResources[1],