-
Notifications
You must be signed in to change notification settings - Fork 26
[#610] [Part 1] Update navigation library and refactor template to expose event callback to navigate #611
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
base: bug/606-fix-incorrect-imports-in-homescreentest-and-mockutil
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
8f23608
to
d220269
Compare
Kover report for template-compose:🧛 Template - Compose Unit Tests Code Coverage:
|
File | Coverage |
---|---|
AppDestination.kt |
75.00% |
AppNavGraph.kt |
52.35% |
BaseViewModel.kt |
72.90% |
HomeScreen.kt |
67.89% |
HomeViewModel.kt |
100.00% |
MainDestination.kt |
60.00% |
MainNavGraph.kt |
37.50% |
Modified Files Not Found In Coverage Report:
BaseAppDestination.kt
HiltTestRunner.kt
HomeScreenTest.kt
HomeScreenTest.kt
HomeViewModelTest.kt
Item.kt
ItemList.kt
NavHostControllerExt.kt
NavigationExt.kt
SecondScreen.kt
ThirdScreen.kt
build.gradle.kts
libs.versions.toml
Codebase cunningly covered by count Shroud 🧛
Generated by 🚫 Danger
d220269
to
b3efc02
Compare
…irectional data flow for sample compose
b3efc02
to
b651f17
Compare
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.
Pull Request Overview
This PR updates the navigation library and refactors the app’s navigation approach by exposing event callbacks instead of using internal navigator flows. Key changes include refactoring HomeViewModel and HomeScreen to remove the internal navigator, updating navigation tests accordingly, and migrating from BaseDestination to BaseAppDestination for navigation.
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
HomeViewModelTest.kt | Removed navigation test and ensured models are loaded via explicit getModels() call. |
HomeScreenTest.kt (unit & androidTest) | Updated test callbacks for navigation and replaced BaseDestination usage with explicit event mocks and NavHostController navigation assertions. |
ThirdScreen.kt, SecondScreen.kt, ItemList.kt, Item.kt | Adjusted navigation and click callback parameters to use event callbacks with simplified parameter types. |
HomeViewModel.kt | Moved navigation logic out and exposed getModels() and checkIfFirstTimeLaunch() as explicit functions. |
MainNavGraph.kt, MainDestination.kt, BaseAppDestination.kt, AppNavGraph.kt, AppDestination.kt | Transitioned navigation types from BaseDestination to BaseAppDestination and updated composable navigation functions. |
NavigationExt.kt, NavHostControllerExt.kt | Introduced new navigation extensions and throttling mechanisms. |
androidTest/HomeScreenTest.kt, HiltTestRunner.kt | Updated androidTest setup with Hilt support and TestNavHostController for navigation assertions. |
app/build.gradle.kts | Modified testInstrumentationRunner to use the HiltTestRunner. |
Comments suppressed due to low confidence (2)
sample-compose/app/src/androidTest/java/co/nimblehq/sample/compose/ui/screens/main/home/HomeScreenTest.kt:93
- The current navigation assertion calls hasRoute without verifying its result. Consider adding an explicit assertion (e.g., assertTrue) to confirm that the navigated route matches the expected one.
navController.currentBackStackEntry?.destination?.hasRoute(MainDestination.Second.route, null)
sample-compose/app/src/androidTest/java/co/nimblehq/sample/compose/ui/screens/main/home/HomeScreenTest.kt:104
- The navigation check for the Third screen does not assert the return value of hasRoute. Adding an explicit assertion would improve test reliability.
navController.currentBackStackEntry?.destination?.hasRoute(MainDestination.Third.route, null)
#610
What happened 👀
Insight 📝
test
directory as usual without needing an emulator or a real deviceHomeScreenTest
as usualHomeScreenTest
underandroidTest
and we will need an emulator or a real deviceProof Of Work 📹
CI should pass for all Unit tests
Home screen UI test
ScreenRecording.mp4