Skip to content

docs(testing): document CV flakiness and high-leverage assert patterns - #109

Merged
racitores merged 2 commits into
mainfrom
docs/cv-stale-press-flakiness
Aug 4, 2026
Merged

racitores merged 2 commits into
mainfrom
docs/cv-stale-press-flakiness

Conversation

@racitores

@racitores racitores commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Expands component-view guidance with patterns learned from Mobile CV work:

  1. Stale press targets (Mobile #34241) — do not hold an element across awaits when the UI re-renders on a timer; re-query immediately before fireEvent.press. Prefer default { name: Routes.X } route probes.
  2. Migration assert parity (MMQA-2104 / Mobile #34197) — unit→CV must not weaken deleted expects (tabId, filterId, formatted dates, full analytics). Mandatory gap-check in unit-cv-overlap.
  3. Filter both-sides — Golden Rule 10 already required this; add an explicit antipattern: analytics/refetch alone is not enough — seed distinct before/after rows.
  4. Loading / skeleton honesty — pending-phase tests must match production UX (skeleton / not-yet-visible), not optimistic titles the screen does not show while loading.
  5. RefreshControl + flag overrides — call refreshControl.props.onRefresh inside act; drive flag-gated sheets via Redux / remote-flag overrides.

Files updated (testing/mobile-testing)

  • references/component-view.md — Golden Rules 10–12
  • references/component-view/writing-tests.md — high-leverage interaction pitfalls
  • references/component-view/navigation-mocking.md — analytics-only filter antipattern
  • references/component-view/reference.md — self-review 5/11–13, diagnosing failures, assertion patterns, What NOT to Do
  • references/placement/unit-cv-overlap.md — mandatory assert-parity gap check before DELETE
  • CHANGELOG.md

Type of Change

  • Skill improvement/update
  • New skill
  • Bug fix
  • Documentation update
  • Other (please describe):

Checklist

  • I have read the CONTRIBUTING.md guidelines
  • My skill follows the SKILL_TEMPLATE.md format
  • I have tested this skill with an AI agent
  • My skill does not contain any secrets, private keys, or sensitive data
  • I have added appropriate documentation
  • My changes don't break existing skills

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 for docs/testing/component-view-tests.md can follow separately if desired.

racitores and others added 2 commits August 4, 2026 11:16
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 racitores changed the title docs(testing): document CV stale-press flakiness patterns docs(testing): document CV flakiness and high-leverage assert patterns Aug 4, 2026
@racitores
racitores enabled auto-merge (squash) August 4, 2026 09:35
@racitores
racitores merged commit 2d04b15 into main Aug 4, 2026
28 checks passed
@racitores
racitores deleted the docs/cv-stale-press-flakiness branch August 4, 2026 09:38
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>
MajorLift added a commit that referenced this pull request Aug 31, 2026
The 25 conflicts were all in files this branch picked up when #97 merged in,
never in its own `domains/stability/` content. `main` has since carried five
more commits over those same files — #109, #115, #54, #120, #132 — against
this branch's single snapshot of them, so `main` is authoritative for every
one and its version is taken throughout.

That includes six deletions: #120 dropped Detox E2E, and the four
`references/detox/` files plus `detox-to-appium.md` and
`detox/legacy-playbook.md` go with it. Nothing references them.

The merged tree now differs from `main` only in the `CODEOWNERS` line this PR
adds and its five `domains/stability/` files.
andrepimenta added a commit that referenced this pull request Sep 7, 2026
Step 2 of docs/processes/releasing.md — "review the generated CHANGELOG.md
section and keep entries consumer-facing". The generated section needed it in
two places.

`### Uncategorized` held ten merged PRs that never got a hand-written entry.
Since `package.json` `files` ships `domains/` alongside `bin/` and `tools/`,
skill content reaches consumers on upgrade, so most of these are genuinely
user-facing and belong in the notes rather than being dropped. Rewritten from
the consumer's point of view and grouped by theme rather than one line per PR:
the component-view testing work (#109, #115, #132) reads as one change, as does
the Mobile testing default plus the Appium playbook move (#70, #54).

Dropped #63 and #77 — `.cursor` review rules and `.github`/`CONTRIBUTING`
changes are not in the published package, so an upgrading consumer sees nothing
of them.

`### Added` had the same problem less visibly: around a dozen raw
conventional-commit titles (`feat: add ...`, `feat(cli): ...`) that read as
commit log rather than release notes. Prefixes stripped, past tense applied.
Three were duplicates of curated entries for the same PR (#136, #75, and the
component-view flakiness line now covered by the #109 entry) and were removed.

Verified: `lint:changelog` passes, 69/69 tests, lint clean, `pack:dry-run` ok.
No `Uncategorized` section and no conventional-commit prefixes remain.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

2 participants