-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: Navigation Service Fix #82
Conversation
Warning Rate Limit Exceeded@alichherawalla has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 28 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe updates focus on refining the navigation architecture in a React application. Key modifications include better encapsulation of the navigator instance within an object and direct imports of specific navigation functions. Additionally, the build process has been adjusted to trigger more appropriately on GitHub Actions. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Coverage reportTotal coverage
Report generated by 🧪jest coverage report action from 612f8fb |
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.
Actionable comments posted: 2
e32c64f
to
e504170
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.
Actionable comments posted: 3
553e831
to
e504170
Compare
e504170
to
f012b0b
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.
Actionable comments posted: 3
expect(navigateAndReset).toHaveBeenCalled(); | ||
expect(navigateAndReset).toHaveBeenCalledWith('MainScreen'); |
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.
The test case correctly checks if navigateAndReset
is called with the expected arguments. However, consider using toHaveBeenCalledTimes(1)
for more precise testing.
- expect(navigateAndReset).toHaveBeenCalled();
+ expect(navigateAndReset).toHaveBeenCalledTimes(1);
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
expect(navigateAndReset).toHaveBeenCalled(); | |
expect(navigateAndReset).toHaveBeenCalledWith('MainScreen'); | |
expect(navigateAndReset).toHaveBeenCalledTimes(1); | |
expect(navigateAndReset).toHaveBeenCalledWith('MainScreen'); |
app/services/NavigationService.js
Outdated
* @param params Route parameters. | ||
*/ | ||
function navigate(routeName, params) { | ||
navigator.dispatch( | ||
navigatorObject.navigator.dispatch( |
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.
The navigate
function correctly uses navigatorObject
to dispatch navigation actions. Ensure this function is covered by unit tests to prevent regressions.
Please add test coverage for the navigate
function to ensure its functionality.
app/services/NavigationService.js
Outdated
* @param params Route parameters. | ||
*/ | ||
function navigateAndReset(routeName, params) { | ||
navigator.dispatch( | ||
navigatorObject.navigator.dispatch( |
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.
The navigateAndReset
function correctly uses navigatorObject
for navigation stack replacements. It is crucial to add tests for this function to verify its behavior, especially since it's used to reset the navigation stack.
It's crucial to add tests for navigateAndReset
to verify its behavior, especially since it's used to reset the navigation stack.
Coverage report
Show files with reduced coverage 🔻
Test suite run success48 tests passing in 20 suites. Report generated by 🧪jest coverage report action from 0b529ae |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Analysis Details1 IssueCoverage and DuplicationsProject ID: wednesday-solutions_react-native-template_AY7hdnRSB2n8RRmGoU2M |
Ticket Link
Related Links
Description
Steps to Reproduce / Test
GIF's
Summary by CodeRabbit
master
branch.