Repository navigation
docs(web): add test guide rules from test cleanup - #45447
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #45447 +/- ##
=======================================
Coverage 89.80% 89.80%
=======================================
Files 6240 6240
Lines 390960 390958 -2
Branches 79180 79177 -3
=======================================
Hits 351114 351114
+ Misses 33751 33749 -2
Partials 6095 6095
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
hyoban
marked this pull request as ready for review
November 3, 2026 09:42
lyzno1
approved these changes
Nov 3, 2026
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.
Extend the Web testing guide with six rules from recent test cleanups.
it.fails).setCanvasremoved in the test(web): replace AP1/AP3/AP11/AP30/AP32 test doubles #45197 follow-up (test(web): follow-up fixes from cleanup review #45420).generator-query-presetin test(web): follow-up fixes from cleanup review #45420.Provenance
Source PRs for each rule, taken from the cleanup-batch notes and the 2026-11-03 review of the merged cleanup PRs (#44812–#45383). APn refers to the cleanup anti-pattern catalog. Entries marked "(anti-example)" introduced the pattern that the rule now forbids. "?" marks a weaker or indirect link.
1. No tolerant assertions; use
it.failswith an issuetypeof v === 'string' ? JSON.parse(v) : v.it.failsand is proven by a fail/pass/fail triad (issue Workflow run Result panel double-encodes structured outputs as a JSON string #45441).result-tab.tsx; strict single-parse contract isit.fails(issue Web app text-generation DETAIL tab double-encodes workflow outputs as a JSON string (ResultTab) #45444).2. Mocks must not reimplement the owner; no prop recorders or manually invoked captured callbacks
setShow*Modalcallbacks by hand.filterVaroption was invoked directly instead of seeding reachable producers.useSyncExternalStoresubscription of the home banner owner.3. Timers and
waitForwaitForbefore negative persistence checks.waitForleaves little CI margin.c3703cc9c6removed a real-time tooltip wait (AP23).vi.stubGlobal('jest', …)timer bridge in the snippet and agent-strategy search specs.web/test/debounce.ts.4. Render-time initial state; non-empty state before reset or clear
initialStoreState, not set after render.act(() => subject.setCanvas(...))wrote internal state.setCanvaswith a controlled caller that closes and reopens the session through user clicks.initialStoreState/ render-time seeding).5. Side-effect-free shared helpers and presets
guardUnexpectedFetch()is registered per suite; module-levelafterEachassertions were removed.web/test/unexpected-fetch.ts, with no import-time hooks.generator-query-preset.ts("helpers seed fresh clients only when called").6. Rewrite race and sync cases through real entry points before deleting them
collaborationManager.graph_update, and the manager spies were removed ("old direct state mutation does not establish unreachability").Scope: 59
test(web)cleanup PRs (#44243–#45440), plus the review follow-up notes. The AP23/AP24/AP25 "review traps" came from an off-GitHub review on 2026-10-21; none of these PRs has GitHub review comments.