Skip to content
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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

yongsuk44
Copy link
Contributor

What I have done and why

  • Add given for 'DynamicColorPreference' in SettingsViewModel
  • Add successful case for deleting RecentSearchQuery
  • Add successful case for setNewsResourceViewed

Do tests pass?

  • Run local tests on DemoDebug variant: ./gradlew testDemoDebug
  • Check formatting: ./gradlew --init-script gradle/init.gradle.kts spotlessApply

@yongsuk44
Copy link
Contributor Author

@JoseAlcerreca RFR :)

@yongsuk44
Copy link
Contributor Author

Fixed Issue - #1337

@keyboardsurfer
Copy link
Member

@yongsuk44 please take a look at the conflicts and resolve them so we can proceed integrating this PR.

Copy link
Collaborator

@dturner dturner left a 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()
Copy link
Collaborator

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))
Copy link
Collaborator

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

Copy link
Collaborator

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.

Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required?

@dturner
Copy link
Collaborator

dturner commented Dec 17, 2024

Please resolve conflicts

@dturner dturner added the waiting Waiting on (blocked by) someone or something label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Waiting on (blocked by) someone or something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants