fix: Navigating twice to the login screen on onboarding on login#23974
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
| @@ -629,7 +629,6 @@ describe('Onboarding', () => { | |||
| }); | |||
|
|
|||
| expect(Authentication.lockApp).toHaveBeenCalled(); | |||
There was a problem hiding this comment.
Bug: Test weakened by removing navigation assertion (Bugbot Rules)
The test "navigates to LOGIN when unlock is pressed and password is set" now only verifies that Authentication.lockApp was called, but doesn't verify the critical { navigateToLogin: true } parameter was passed. Since the production code changed from calling navigation.replace separately to passing this parameter to lockApp, the test assertion should be updated to expect(Authentication.lockApp).toHaveBeenCalledWith({ navigateToLogin: true }) to maintain equivalent coverage of the navigation behavior.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #23974 +/- ##
==========================================
+ Coverage 78.97% 78.99% +0.01%
==========================================
Files 4050 4052 +2
Lines 106496 106578 +82
Branches 21539 21557 +18
==========================================
+ Hits 84109 84186 +77
- Misses 16519 16526 +7
+ Partials 5868 5866 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe change is a minor refactoring in the Onboarding component's The The test file was updated accordingly to remove the assertion checking for This is a low-risk refactoring change that:
SmokeCore is selected because it covers core wallet functionality, framework, app state, and navigation - all of which are relevant to this authentication/onboarding flow change. |
| @@ -629,7 +629,6 @@ describe('Onboarding', () => { | |||
| }); | |||
|
|
|||
| expect(Authentication.lockApp).toHaveBeenCalled(); | |||
There was a problem hiding this comment.
Bug: Test no longer verifies navigation behavior (Bugbot Rules)
The test named "navigates to LOGIN when unlock is pressed and password is set" removed the assertion that verified navigation occurs (mockReplace.toHaveBeenCalledWith(Routes.ONBOARDING.LOGIN)) but doesn't verify that Authentication.lockApp is called with the correct { navigateToLogin: true } parameter. The test now only checks that lockApp was called, not that it was called with parameters that would cause navigation. Per the testing guidelines, the test name describes behavior that is no longer being validated - this violates the coverage requirement that tests verify their stated behavior.
|



Description
Navigating twice to login fix
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
On onboarding unlock, pass navigateToLogin to Authentication.lockApp and remove explicit navigation; update tests to reflect new behavior.
onLogininapp/components/Views/Onboarding/index.tsxto callAuthentication.lockApp({ navigateToLogin: true })whenpasswordSetis true, removingnavigation.replace(Routes.ONBOARDING.LOGIN).app/components/Views/Onboarding/index.test.tsxto stop assertingnavigation.replacetoRoutes.ONBOARDING.LOGIN, verifying onlyAuthentication.lockAppis called.Written by Cursor Bugbot for commit 412ba83. This will update automatically on new commits. Configure here.