test(web): cover the untested hooks + components — ratchet moves up#180
Merged
Conversation
68 new tests across the untested web surface:
- hooks/useAscend (8): the two-fetch OUTWARD contract (generate-page
mode:"ascend" → /api/world/{sid}/ascend persist), optional
session_style_anchor / suppress_map_labels body fields, the onAscended
payload (incl. render_unjudged), every error surface (HTTP, stream
error event, no ascend_ready, persist body), and re-start abort.
- hooks/useWorldMode (8): per-session localStorage persistence +
rehydrate, garbage coercion, and the NEXT_PUBLIC_WORLD_MODE /
_DOM_LABELS build-time seeds (stored toggle wins).
- hooks/useSharedSession (8): presence heartbeat → viewers, feed frames
(hello/presence/node_added), own-page echo filter through the live
ref, the `unsupported` standalone-Mongo degrade, malformed-frame skip,
and teardown — over a hand-driven FakeEventSource.
- hooks/useWorldMap (6): hydrate, empty-map fallback (never null with a
session), best-effort error keep-prior, refetch, session clearing.
- hooks/useContainRect (7): PINS THE #48 REGRESSION — a ref that is null
at mount polls until the img appears, then attaches ResizeObserver
(no one-shot bail / invisible marquee); plus letterbox math, the
null-until-natural-dims contract, load/resize re-measure, cleanup.
- components QueryToolbar (7), MapLabelOverlay (7), HintPrompt (7),
MorphImagePair (10): render + key interactions per house style.
Coverage (apps/web totals) and the ratchet:
lines 66.01 → 71.89 floor 65 → 70
statements 66.01 → 71.89 floor 65 → 70
functions 70.66 → 73.40 floor 69 → 72
branches 85.32 → 86.24 floor 84 → 85
Notes: happy-dom drops inline mask-* declarations, so MorphImagePair
pins the ink-bloom branch via its transition target (mask geometry
already covered by lib/morph-style.test.ts) and the ↵ control by its
type=submit wiring. Suite: 98 files / 772 tests green with the new
floors; typecheck, lint (0 errors), check:circular all pass.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
PR D of the coverage campaign — 68 new tests across the five untested hooks and four untested components:
onAscendedpayload, all four error surfaces, re-start abort semantics.Ratchet: lines 66.0 → 71.9, functions 70.7 → 73.4, branches 85.3 → 86.2; thresholds bumped 65/65/69/84 → 70/70/72/85. 772 web tests + tsc + lint + circular green.
🤖 Generated with Claude Code