-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Missing Test Cases #1320
base: main
Are you sure you want to change the base?
Conversation
...otlin/com/google/samples/apps/nowinandroid/core/testing/repository/TestUserDataRepository.kt
Outdated
Show resolved
Hide resolved
@JoseAlcerreca RFR :) |
Fixed Issue - #1337 |
@yongsuk44 please take a look at the conflicts and resolve them so we can proceed integrating this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this, and apologies for the delay in reviewing. Please see comments.
), | ||
), | ||
) | ||
val userNewsResources = userNewsResourceRepository.observeAllForFollowedTopics() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the test in this way tests a different method: observeAllForFollowedTopics, which is tested in an identical way in the test below.
This test should be left as-is. It tests the scenario where a user is not following any of those topics but is still viewing them. For example, when viewing the TopicDetail screen for a topic that they're not following.
userDataRepository.setUserData(userData) | ||
userDataRepository.setNewsResourceBookmarked(sampleNewsResources[0].id, true) | ||
userDataRepository.setNewsResourceBookmarked(sampleNewsResources[2].id, true) | ||
userDataRepository.setFollowedTopicIds(setOf(sampleTopic1.id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use named arguments e.g. bookmarked=true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This deletion doesn't look relevant to this PR so should be removed from the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This deletion doesn't look relevant to this PR so should be removed from the PR.
@@ -25,6 +26,7 @@ import androidx.navigation.navArgument | |||
import androidx.navigation.navDeepLink | |||
import com.google.samples.apps.nowinandroid.feature.foryou.ForYouRoute | |||
|
|||
@VisibleForTesting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required?
Please resolve conflicts |
What I have done and why
SettingsViewModel
setNewsResourceViewed
Do tests pass?
DemoDebug
variant:./gradlew testDemoDebug
./gradlew --init-script gradle/init.gradle.kts spotlessApply