[No QA] Fix SubmitPlanWelcomeModal test by rendering inside NavigationContainer - #96067
[No QA] Fix SubmitPlanWelcomeModal test by rendering inside NavigationContainer#96067MelvinBot wants to merge 4 commits into
Conversation
Co-authored-by: mkhutornyi <mkhutornyi@users.noreply.github.com>
|
@MelvinBot fix failing tests |
|
@MelvinBot close this PR as already fixed on |
Co-authored-by: mkhutornyi <mkhutornyi@users.noreply.github.com>
|
Fixed the failing Oxfmt check. The formatter flagged function renderModal() {
- return render(
- <OnyxListItemProvider>
- {withNavigation(<SubmitPlanWelcomeModal />)}
- </OnyxListItemProvider>,
- );
+ return render(<OnyxListItemProvider>{withNavigation(<SubmitPlanWelcomeModal />)}</OnyxListItemProvider>);
}The |
…rt coverage Co-authored-by: mkhutornyi <mkhutornyi@users.noreply.github.com>
…TestNavigation' into claude-fixSubmitPlanWelcomeModalTestNavigation Co-authored-by: mkhutornyi <mkhutornyi@users.noreply.github.com>
|
Fixed both real failures and pushed to the branch. Two separate tests were red, both fallout from #95099 landing on 1. 2. Also committed the Verified locally:
The remaining |
|
Closing this PR — the fix already landed on |
|
No code fix is needed — the substantive checks are green. The one remaining red check can only be resolved by you. Status
Why the checklist is red: it's not a code failure. The check reports To go green: check the remaining boxes in the PR description's PR Author Checklist once you've verified them, and the check will re-run and pass. |
|
The only failing check on this PR is PR Author Checklist / checklist, which is a manual checklist item, not a code/test failure — there's no code fix to push for it. Also worth noting: this PR is closed, so its checks won't be re-run regardless. The actual CI checks (builds, validate, CLA, Snyk) all passed. If you reopen the PR and still see the checklist marked red, it just needs the author checklist boxes ticked manually. |
Explanation of Change
Main went red because
tests/ui/components/SubmitPlanWelcomeModalTest.tsx(added in #95099) fails to render:This is a logical merge conflict, not a bug in either PR on its own.
SubmitPlanWelcomeModal→FeatureTrainingContent→FormAlertWithSubmitButton→usePressLoading, andusePressLoadingnow callsuseFocusEffect, which requires a navigation context. #95099 was written/tested against amainwhereusePressLoadingdid not yet useuseFocusEffect, so its test rendered the modal without aNavigationContainer. Once both changes landed onmain, the test began throwing at render time.Fix: render the modal inside a
NavigationContainer+ stack screen in the test, following the existing pattern intests/ui/components/FeatureTrainingModalTest.tsx. This is a test-only change — there is no runtime behavior change, since in the app the modal is always mounted inside navigation.Fixed Issues
$ #96038
PROPOSAL:
Tests
npx jest tests/ui/components/SubmitPlanWelcomeModalTest.tsxtest / test) will validate it.Offline tests
N/A — test-only change, no runtime behavior change.
QA Steps
N/A — no user-facing change.
[No QA]PR Author Checklist
### Fixed Issuessection aboveScreenshots/Videos
N/A — test-only change, no UI change.