test(mobile): restore settings regression tests after UI module moves #21280
main fromrefs/pull/21280/head·opened View on GitHubProblem#
Two existing mobile settings regression files fail on main at 699c1c5d4c before they can verify draft persistence and serialized writes. Their mocks still target components/AppText and components/ScreenScrollView, while production imports now use components/ui. The source-control route also eagerly imports the maintenance-only database notice and its Expo dependencies.
The same settings failures appear in this CI run. They were reproduced locally on fresh main before this change.
Change#
Point the three stale mocks at the imported UI modules and stub DatabaseStorageNotice at the existing route-test component boundary. The actual branch-naming component and route write-queue logic remain under test. Every existing assertion is retained.
Scope and approval#
A focused, test-only repair of broken settings test boundaries: four added lines and three removed lines across two existing test files. This is submitted under the small obvious-fix exception. It restores existing regression coverage for leaving a screen with unsaved text and saving a draft while another write is pending.
Verification#
vp test run apps/mobile/src/features/settings/components/BranchNamingSettings.test.tsx apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.test.tsx
| Existing regression coverage | Before on 699c1c5d4c | After |
|---|---|---|
| Branch naming: save on leave, reopen, pending writes, unchanged values | 9 failed (Text missing from native mock) | 9 passed |
| Source-control settings: flush draft after pending write | Suite fails during native-module loading | 1 passed |
After correcting the moved paths, the route still reached Expo and failed with __DEV__ is not defined; stubbing the unrelated database-notice leaf allows its write-queue assertion to run. No assertions were removed, no tests were skipped, and no native globals were added to hide the import failure.
Focused lint and formatting checks passed for both files. Mobile typecheck passed. These are React/jsdom tests; native UI behavior and full CI are not claimed as verified by this test-harness fix. Separate web test dependency failures are outside this PR.
Implemented and tested with OpenAI Codex (gpt-6.1-sol) in T3 Code. Review follow-ups by DeepSeek V4.1 Flash 1017.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Approvability#
Verdict: Approved at
7e19eedMacroscope's review found this PR approvable — The PR is limited to two ignored mobile test files and restores existing regression coverage through small mock-path adjustments. It does not change production behavior, product defaults, or static-analysis configuration.
Notes:
- No code objects were reviewed. Approvability was decided on eligibility alone.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ab8dfeca-2fa2-4f06-99d3-77715050993c
📥 Commits
-
Reviewing files that changed from the base of the PR and between 3adac9403fd8a85f32ff0c2f9f0c236051f1f040 and 7e19eede55b72cabd44a04a304ebd2e4718aeba6.
📒 Files selected for processing: 2
-
apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.test.tsxapps/mobile/src/features/settings/components/BranchNamingSettings.test.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
-
📝 Walkthrough
-
Two settings test files update component mock paths. One test also adds a no-op mock for
DatabaseStorageNotice.Changes: Settings test mock updates
Layer / File(s) Summary Update settings test mocks
apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.test.tsx,apps/mobile/src/features/settings/components/BranchNamingSettings.test.tsxThe tests mock ScreenScrollViewandAppTextfrom theircomponents/uipaths. The server controls test adds a no-opDatabaseStorageNoticemock.Priority: ⬇️ Low
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Other
Suggested reviewers:
adityavardhansharma
Merge Risk: ⚪ Minimal · up to
7e19e-
This change updates settings tests to match current component imports and stubs a child component at the test boundary. No production behavior change or user-facing regression risk is identified.
Pre-merge checks:
4-
Check name Status Explanation Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Title check The title clearly and concisely describes the main change: restoring mobile settings regression tests after UI module moves. Description check The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the failure, the focused test-only fix, the small-obvious-fix rationale, test results,… Full details: Description check
-
Explanation
The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the failure, the focused test-only fix, the small-obvious-fix rationale, test results, limitations, and the tools used.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Note
Grok responding on behalf of Julius.
Thanks for tracking this down. The same settings test fix (pointing the
AppTextandScreenScrollViewmocks atcomponents/uiand stubbingDatabaseStorageNotice) just landed on main in #21293, so I'm closing this as superseded.juliusmarminge closed this
Sign in to join this conversation.
Codex Review Summary#
This comment shows the latest Codex review activity on this pull request.
7e19eedℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.