Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(mobile): branch naming and server controls settings tests load again #21293

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/21293/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Two 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 real AppText imports Text from react-native, which the test's mock doesn't provide.
  • SettingsServerControlsRouteScreen: the real AppText/ScreenScrollView pulled in react-native's untransformed Flow source. Once that was fixed, the unmocked DatabaseStorageNotice loaded 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. juliusmarminge added labelsmacroscope-review

    2. Approvability

      Verdict: Approved at 0dcb7a9

      Macroscope'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).
    3. Thread transfer impact

      ⚠️ The latest CI run did not produce a thread transfer result for 0dcb7a9.

      This comment will update automatically after the next completed run.

    4. Review in Change Stack →

      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.tsx
      • apps/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 ScreenScrollView and AppText from their components/ui module paths. The server controls route test also adds a no-op mock for DatabaseStorageNotice.

      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.tsx
      The tests target updated components/ui paths for UI component mocks. The server controls route test also mocks DatabaseStorageNotice with 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: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly identifies the mobile test fixes for branch naming and server controls settings. It is concise and matches the main changes.
      Description checkPassedThe 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 checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck 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
      Comment `@coderabbitai help` to get the list of available commands.
    5. juliusmarminge merged thisf7dd1a3

    6. juliusmarminge closed this

Sign in to join this conversation.