test(mobile): branch naming and server controls settings tests load again #21293
main fromrefs/pull/21293/head·merged by juliusmarminge View on GitHubTwo mobile tests fail on main (CI run), introduced by #18381:
BranchNamingSettings.test.tsx:No "Text" export is defined on the "react-native" mock.SettingsServerControlsRouteScreen.test.tsx:SyntaxError: Unexpected token 'typeof'
Cause#
Both tests mocked components/AppText (and components/ScreenScrollView), which moved to components/ui/ in #20043. The mocks matched nothing, so the real modules loaded:
BranchNamingSettings: the realAppTextimportsTextfromreact-native, which the test's mock doesn't provide.SettingsServerControlsRouteScreen: the realAppText/ScreenScrollViewpulled in react-native's untransformed Flow source. Once that was fixed, the unmockedDatabaseStorageNoticeloaded expo modules that fail on__DEV__.
Fix#
Point the mocks at components/ui/AppText and components/ui/ScreenScrollView, and mock DatabaseStorageNotice like the other settings sections. No assertions changed.
Claude Opus 5.5 via Claude Code.
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
juliusmarminge added labelsmacroscope-review
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
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
8c6758e3-7ae9-49fb-a08a-aa29ae4c9cba
📥 Commits
-
Reviewing files that changed from the base of the PR and between e2cc34f1e47a9a9f0798080ecbad44a196b2923c and 0dcb7a91e73fcebe1b3186ebbbd0308f10cc13b0.
📒 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; 8 remain after this review.
-
📝 Walkthrough
-
Settings tests now mock
ScreenScrollViewandAppTextfrom theircomponents/uimodule paths. The server controls route test also adds a no-op mock forDatabaseStorageNotice.Changes: Settings test mock updates
Layer / File(s) Summary Align settings test mocks
apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.test.tsx,apps/mobile/src/features/settings/components/BranchNamingSettings.test.tsxThe tests target updated components/uipaths for UI component mocks. The server controls route test also mocksDatabaseStorageNoticewith an empty render.Priority: ⬇️ Low
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Bug fix
Suggested reviewers:
adityavardhansharma
Merge Risk: ⚪ Minimal · up to
0dcb7-
This change updates mocks in two mobile tests and adds a test-only stub. No material merge risk is established in the supplied context; it is mergeable under normal checks.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly identifies the mobile test fixes for branch naming and server controls settings. It is concise and matches the main changes. Description check The description explains the failing tests, root cause, affected module paths, and implemented fix. It includes a CI reference and identifies the agent used. It does not state the post-fix test result… 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. Full details: Description check
-
Explanation
The description explains the failing tests, root cause, affected module paths, and implemented fix. It includes a CI reference and identifies the agent used. It does not state the post-fix test results or explicitly explain the scope and approval exemption for this focused fix, but the core required information is present.
-
✨ Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge merged thisf7dd1a3
juliusmarminge closed this
Sign in to join this conversation.
Approvability#
Verdict: Approved at
0dcb7a9Macroscope's review found this PR approvable — This is a small, test-only maintenance change that updates mocks so two mobile settings tests load correctly. It does not alter production behavior, product defaults, schemas, deployment, or sensitive code.
Notes:
- No code objects were reviewed. Approvability was decided on eligibility alone.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).