Skip to content

test(mobile): split the turn-disclosure test under the 800-line test limit - #25933

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/split-turn-disclosure-test
Oct 6, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/split-turn-disclosure-test

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Main's Lint check is red. A mobile test file, mobile/src/session/use-mobile-native-chat-turn-disclosure.test.tsx, grew past the 800-line limit for test files (816 counted lines when #19221 landed, 875 now). When Lint fails, CI skips typecheck and every unit test shard, so every PR that merges current main currently gets no real CI signal.

What Changed

Test-only split, no behaviour change:

  • The journal-backed tests (it.each(hosts) cases with their journalOf / said / record helpers) move to use-mobile-native-chat-turn-disclosure-journal.test.tsx, under their own describe with the same render/unmount setup.
  • The shared Harness component and userMessage helper move to use-mobile-native-chat-turn-disclosure.test-fixture.tsx so both files use one copy.
  • Every test case is moved verbatim; no assertion changed.
  • The tests now typecheck under mobile/tsconfig.test.json: the harness renders a small Result component instead of a 'result' host string (React Native's ElementType has no string members), and the tests read it with findByType(Result). So the original file comes off mobile/tests-typecheck-baseline.txt (the ratchet list shrinks by one) and the new journal file is checked from the start.

Line counts: 564 + 284 (+ 50 fixture), down from 875.

Why

Splitting by the test's own seam (journal-backed vs. message-only cases) keeps each file cohesive, instead of raising the limit or disabling the rule.

Linked Issue

None. This fixes main's Lint after #19221.

Visual Proof

N/A: test files only.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

oxlint (root config and mobile/.oxlintrc.json) and oxfmt are clean on all three files. tsc -p mobile/tsconfig.test.json reports no errors in either turn-disclosure test file. The tests themselves run in CI's Mobile Checks.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No production code touched; no effect on platforms, SSH or the runtime.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b787e4e-7ec7-4494-8ba1-e12b9987dd8b
📥 Commits

Reviewing files that changed from the base of the PR and between f27ef42 and 2ce069f.

📒 Files selected for processing (4)
  • mobile/src/session/use-mobile-native-chat-turn-disclosure-journal.test.tsx
  • mobile/src/session/use-mobile-native-chat-turn-disclosure.test-fixture.tsx
  • mobile/src/session/use-mobile-native-chat-turn-disclosure.test.tsx
  • mobile/tests-typecheck-baseline.txt
💤 Files with no reviewable changes (1)
  • mobile/tests-typecheck-baseline.txt

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The change adds a shared test fixture for useMobileNativeChatTurnDisclosure and updates existing tests to use it. It moves journal-based coverage into a separate test file and adds cases for turn status, row placement, and ordering across hosts with and without per-row turn scope. The typecheck baseline no longer excludes the existing test file.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 2ce06

This change reorganizes tests only and does not alter product behavior. The remaining step is confirming that CI's Mobile Checks pass.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes splitting the turn-disclosure test to meet the test-file line limit.
Description check ✅ Passed The description covers the change, reason, testing, visual-proof exception, and checklist. It states that no issue is linked; the template requires an issue for outside contributors but says maintaine…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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