docs(testing): document CV flakiness and high-leverage assert patterns - #109
Merged
Conversation
Capture the live-clock re-render race (re-query before press) and default route-probe guidance in mobile-testing component-view refs so agents fix CI flakes the same way as MetaMask Mobile PR #34241. Co-authored-by: Cursor <cursoragent@cursor.com>
Capture migration assert parity, filter both-sides (analytics alone is not enough), loading/skeleton honesty, RefreshControl + flag overrides, and the overlap gap-check so agents avoid the same CV regressions. Co-authored-by: Cursor <cursoragent@cursor.com>
racitores
enabled auto-merge (squash)
August 4, 2026 09:35
jvbriones
approved these changes
Aug 4, 2026
3 tasks
racitores
added a commit
that referenced
this pull request
Aug 7, 2026
## Summary - Add CV guidance for the flake class where a **container mounts before a child value settles** (own query / debounce / skeleton). - Encode it as Golden Rule 13, a writing-tests pitfall, self-review checklist item, diagnosing-failures row, assertion pattern, and What NOT to Do example in `mobile-testing` component-view refs. - Motivated by the intermittent `PredictMarketDetails` Positions-tab `$60` failure on metamask-mobile `main` CI (sync `getByText` after awaiting only the tab container). ## Test plan - [x] `yarn audit:skills` — 0 errors - [x] `yarn test` — 61/61 pass - [ ] Reviewer: confirm the rule complements (does not duplicate) the existing stale-press-target guidance from #109 / metamask-mobile #34241 Made with [Cursor](https://cursor.com) Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Expands component-view guidance with patterns learned from Mobile CV work:
awaits when the UI re-renders on a timer; re-query immediately beforefireEvent.press. Prefer default{ name: Routes.X }route probes.tabId,filterId, formatted dates, full analytics). Mandatory gap-check inunit-cv-overlap.refreshControl.props.onRefreshinsideact; drive flag-gated sheets via Redux / remote-flag overrides.Files updated (
testing/mobile-testing)references/component-view.md— Golden Rules 10–12references/component-view/writing-tests.md— high-leverage interaction pitfallsreferences/component-view/navigation-mocking.md— analytics-only filter antipatternreferences/component-view/reference.md— self-review 5/11–13, diagnosing failures, assertion patterns, What NOT to Doreferences/placement/unit-cv-overlap.md— mandatory assert-parity gap check before DELETECHANGELOG.mdType of Change
Checklist
Testing
Reviewed guidance against Mobile CV fixes in #34241 and the MMQA-2104 Predict unit↔CV pass (#34197). No installer/CLI behavior change.
Additional Context
Highest-leverage items first (parity, filter both-sides example, loading honesty, RefreshControl/flags), on top of the existing stale-press / route-probe docs.
After merge, Mobile consumers pick this up on next
metamask-skills sync --include testing/mobile-testing. Companion in-repo doc sync fordocs/testing/component-view-tests.mdcan follow separately if desired.