Skip to content

[leas code] Centralize mobile renderer test setup - #13408

Merged
nwparker merged 1 commit into
mainfrom
nwparker/leas-code-mobile-test-setup
Aug 10, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/leas-code-mobile-test-setup

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

  • move the React act-environment flag into one Vitest setup file
  • use Vitest native console filtering for the react-test-renderer deprecation
  • remove 63 repeated act assignments and 53 pure suppression sites
  • retain local error observers in the eight tests that intentionally validate unexpected console errors
  • reduce mobile test code by 941 net lines

Verification

  • pnpm -C mobile test: 438 files, 3,427 tests passed
  • 12 focused console-observer files: 65 tests passed
  • pnpm -C mobile typecheck
  • pnpm -C mobile lint
  • pnpm -C mobile format:check
  • pnpm run check:code-quality:changed
  • count audit: one act site and nine deprecation sites total, covering config plus eight intentional test files

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The mobile test suite centralizes React act-environment setup in Vitest. Tests remove local IS_REACT_ACT_ENVIRONMENT assignments and React Test Renderer warning suppression. Renderer creation now runs directly inside act, with existing cleanup retained. Terminal stream tests add coverage for stream replacement, re-subscription, bounded retries, rearm budget restoration, revision-based teardown, and late WebView readiness.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description summarizes the change and verification, but it omits the required Screenshots, Testing, AI Review Report, Security Audit, and Notes sections. Add the missing template sections and include screenshots or state “No visual change,” test checklist results, AI review details, security audit findings, and platform notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 2.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: centralizing mobile renderer test setup.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
mobile/src/session/QuickCommandsList.test.ts (1)

32-32: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the empty beforeEach hook.

beforeEach(() => {}) no longer changes test state after the act-environment assignment moved to mobile/vitest.setup.ts. Remove this hook and its import so the test does not retain dead lifecycle code.

mobile/src/session/use-mobile-native-chat-terminal-stream.test.ts (1)

116-117: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Condense the new test comments.

Keep each comment to one concise line. Retain only branch-specific context.

  • mobile/src/session/use-mobile-native-chat-terminal-stream.test.ts#L116-L117: Combine the teardown simulation comment into one line.
  • mobile/src/session/use-mobile-native-chat-terminal-stream.test.ts#L125-L126: Combine the rearm-branch rationale into one line.
  • mobile/src/session/use-mobile-native-chat-terminal-stream.test.ts#L135-L136: Combine the dead-PTY behavior description into one line.
  • mobile/src/session/use-mobile-native-chat-terminal-stream.test.ts#L208-L209: Combine the retry-budget rationale into one line.
  • mobile/src/session/use-mobile-native-chat-terminal-stream.test.ts#L230-L231: Combine the revision-trigger rationale into one line.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 28cb0700-f791-4a21-8d12-e6c18c3392f6

📥 Commits

Reviewing files that changed from the base of the PR and between ac83068 and 1fe899d.

📒 Files selected for processing (70)
  • mobile/src/accounts-route-reset-credit.test.ts
  • mobile/src/components/CodexResetCreditAction.test.ts
  • mobile/src/components/HostProtocolGate.test.ts
  • mobile/src/components/MobileHomeQuickActions.test.ts
  • mobile/src/components/MobileHostCard.test.ts
  • mobile/src/components/MobileHostCard.test.tsx
  • mobile/src/components/MobileMarkdown.file-links.test.ts
  • mobile/src/components/NewWorktreeModal.test.tsx
  • mobile/src/components/PickerModal.accessibility.test.ts
  • mobile/src/components/WorktreeAgentList.test.tsx
  • mobile/src/components/WorktreeListRow.test.ts
  • mobile/src/components/bottom-drawer-close-lifecycle.test.ts
  • mobile/src/components/mobile-agent-icon-gradient.test.ts
  • mobile/src/components/pr-sidebar/PRCommentsSection.test.ts
  • mobile/src/files/MobileFileExplorerPanel.test.ts
  • mobile/src/files/MobileFileMarkdownPreview.test.ts
  • mobile/src/hooks/use-now.test.ts
  • mobile/src/host-edit-route-accessibility.test.ts
  • mobile/src/host-edit-save-flow.test.ts
  • mobile/src/onboarding/MobileOnboardingPage.test.ts
  • mobile/src/onboarding/mobile-onboarding-screen.test.ts
  • mobile/src/session/MobileNativeChatComposer.test.ts
  • mobile/src/session/MobileNativeChatMessage.test.ts
  • mobile/src/session/MobileNativeChatOverlay.test.ts
  • mobile/src/session/MobileNativeChatPermission.test.ts
  • mobile/src/session/MobileNativeChatSessionOptionPickers.test.ts
  • mobile/src/session/MobileNativeChatView.test.ts
  • mobile/src/session/QuickCommandsList.test.ts
  • mobile/src/session/QuickCommandsSheet.test.ts
  • mobile/src/session/mobile-native-chat-permission-send.test.ts
  • mobile/src/session/use-initial-session-terminal-autocreate.test.ts
  • mobile/src/session/use-live-worktree-name.test.ts
  • mobile/src/session/use-missing-worktree-bounce.test.ts
  • mobile/src/session/use-mobile-attachment-input-lease-gate.test.ts
  • mobile/src/session/use-mobile-default-session-view-preference.test.ts
  • mobile/src/session/use-mobile-diff-review-controller.test.ts
  • mobile/src/session/use-mobile-diff-review-diff-loading.test.ts
  • mobile/src/session/use-mobile-diff-review-send-actions.test.ts
  • mobile/src/session/use-mobile-file-tap-handlers.test.ts
  • mobile/src/session/use-mobile-native-chat-answer-send.test.ts
  • mobile/src/session/use-mobile-native-chat-ask-dismiss.test.ts
  • mobile/src/session/use-mobile-native-chat-controller.test.ts
  • mobile/src/session/use-mobile-native-chat-drafts-launch-draft.test.ts
  • mobile/src/session/use-mobile-native-chat-drafts.test.ts
  • mobile/src/session/use-mobile-native-chat-file-search.test.ts
  • mobile/src/session/use-mobile-native-chat-image-attachments.test.ts
  • mobile/src/session/use-mobile-native-chat-input-lease.test.ts
  • mobile/src/session/use-mobile-native-chat-message-send.test.ts
  • mobile/src/session/use-mobile-native-chat-readability.test.ts
  • mobile/src/session/use-mobile-native-chat-send-error.test.ts
  • mobile/src/session/use-mobile-native-chat-session-options.test.ts
  • mobile/src/session/use-mobile-native-chat-session.test.ts
  • mobile/src/session/use-mobile-native-chat-stop.test.ts
  • mobile/src/session/use-mobile-native-chat-terminal-stream.test.ts
  • mobile/src/session/use-mobile-session-tabs-reconciliation.test.ts
  • mobile/src/session/use-mobile-session-view-mode.test.ts
  • mobile/src/session/use-quick-commands.test.ts
  • mobile/src/session/use-terminal-live-input-mode-preference.test.ts
  • mobile/src/session/use-throttled-latest-value.test.ts
  • mobile/src/source-control/MobileGitHistoryList.test.tsx
  • mobile/src/source-control/use-mobile-hosted-review-eligibility.test.ts
  • mobile/src/terminal/terminal-webview-engine-error.test.ts
  • mobile/src/terminal/use-terminal-live-accessory-input-commit.test.ts
  • mobile/src/terminal/use-terminal-live-input-commit.test.ts
  • mobile/src/terminal/use-terminal-live-input-focus.test.ts
  • mobile/src/transport/client-context.test.ts
  • mobile/src/transport/host-status-gates.test.ts
  • mobile/src/transport/settings-host-client-lifecycle.test.ts
  • mobile/vitest.config.ts
  • mobile/vitest.setup.ts
💤 Files with no reviewable changes (21)
  • mobile/src/session/use-mobile-attachment-input-lease-gate.test.ts
  • mobile/src/session/MobileNativeChatSessionOptionPickers.test.ts
  • mobile/src/components/NewWorktreeModal.test.tsx
  • mobile/src/session/use-missing-worktree-bounce.test.ts
  • mobile/src/session/use-mobile-session-view-mode.test.ts
  • mobile/src/session/use-mobile-diff-review-diff-loading.test.ts
  • mobile/src/session/use-mobile-native-chat-message-send.test.ts
  • mobile/src/session/use-mobile-native-chat-session-options.test.ts
  • mobile/src/components/MobileMarkdown.file-links.test.ts
  • mobile/src/session/use-mobile-native-chat-stop.test.ts
  • mobile/src/session/use-mobile-diff-review-controller.test.ts
  • mobile/src/onboarding/mobile-onboarding-screen.test.ts
  • mobile/src/session/use-initial-session-terminal-autocreate.test.ts
  • mobile/src/components/WorktreeListRow.test.ts
  • mobile/src/session/use-mobile-file-tap-handlers.test.ts
  • mobile/src/components/PickerModal.accessibility.test.ts
  • mobile/src/session/use-mobile-session-tabs-reconciliation.test.ts
  • mobile/src/session/mobile-native-chat-permission-send.test.ts
  • mobile/src/components/HostProtocolGate.test.ts
  • mobile/src/transport/host-status-gates.test.ts
  • mobile/src/session/use-mobile-default-session-view-preference.test.ts

@nwparker
nwparker merged commit c56ff58 into main Aug 10, 2026
46 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant