Skip to content

fix(tests): update three fixtures to the APIs and layouts they now target - #2453

Closed
dcccrypto wants to merge 1 commit into
playgroundfrom
fix/pricestore-matcher-state-tests
Closed

fix(tests): update three fixtures to the APIs and layouts they now target#2453
dcccrypto wants to merge 1 commit into
playgroundfrom
fix/pricestore-matcher-state-tests

Conversation

@dcccrypto

Copy link
Copy Markdown
Owner

Third slice of the 65 failures #2450 exposed (after #2451 and #2452). Fixes 4, adds 2. Test files only — no product change.

priceStore-poll (2)

The wsManager mock exposed onMessage (the global raw listener). priceStore subscribes through onMessageForChannel(slab, listener), so subscribeSlab threw manager.onMessageForChannel is not a function and both live-tick tests died before asserting anything.

The mock now keys listeners by channel, matching the real manager. A global list would deliver every tick to every slab — something the real dispatch never does, so the old shape could have hidden cross-slab leakage.

v17-matcher-state (1 fixed, 1 added)

The fixture wrote the delegate at CTX_VAMM_OFFSET, but a 16-byte VAMM magic sits there — the delegate starts at +16. Corroborated by useCreateMarket.v17-matcher-{resume,recovery}.test.ts, which already use +16, so this file was the lone holdout.

Worth calling out: the sibling "rejects a context bound to another delegate" was passing for the wrong reason. Writing 32 bytes at +0 left the real delegate slot half-zeroed, so it mismatched by accident rather than by binding — it would have passed against a broken reader too. Both cases now write at +16, and a new case pins the exact regression the reader's comment describes:

// an untouched delegate slot must read `uninitialized`,
// no matter what the magic region contains

gh1654 (1)

MarketInfoBar no longer imports MarketLogo directly. I checked whether the logo had actually gone missing — it hasn't: it moved into MarketSwitcher, which the bar renders with logoUrl / mintAddress / mainnetCa / symbol. So the GH#1654 guarantee ("the info bar shows a market logo") is intact and the test was stale, not the product.

Since this guards a real past regression, I followed the composition instead of dropping the assertion: the bar must pass the logo props to MarketSwitcher, and MarketSwitcher must render MarketLogo.

Evidence

  • 95 → 91 failures, 28 → 25 files
  • npx tsc --noEmit clean
  • None of the three files still failing
cd app && npx vitest run __tests__/lib/priceStore-poll.test.ts \
  __tests__/lib/v17-matcher-state.test.ts \
  __tests__/unit/gh1654-market-info-bar-visibility.test.ts

Stacks cleanly with #2451 and #2452 — disjoint files, all based on playground.

🤖 Generated with Claude Code

…rget

Third slice of the 65 CI failures #2450 exposed. Fixes 4, adds 2. Test files
only, no product change.

- priceStore-poll: the wsManager mock still exposed `onMessage` (global raw
  listener). priceStore subscribes via `onMessageForChannel(slab, listener)`,
  so `subscribeSlab` threw "manager.onMessageForChannel is not a function" and
  both live-tick tests died. Mock now keys listeners by channel, matching the
  real manager — a global list would deliver every tick to every slab, which
  the real dispatch never does.

- v17-matcher-state: the fixture wrote the delegate at CTX_VAMM_OFFSET, but a
  16-byte VAMM magic sits there and the delegate starts at +16. Corroborated by
  useCreateMarket.v17-matcher-{resume,recovery}.test.ts, which already use +16.
  The sibling "rejects another delegate" case was passing for the wrong reason:
  writing at +0 left the real delegate slot half-zeroed, so it mismatched by
  accident rather than by binding. Both now write at +16, and a new case pins
  the exact regression the reader's comment describes — an untouched delegate
  slot must read `uninitialized` no matter what the magic region holds.

- gh1654: MarketInfoBar no longer imports MarketLogo directly. It moved into
  MarketSwitcher, which the bar renders with logoUrl/mintAddress/symbol — so
  the GH#1654 guarantee ("the info bar shows a market logo") is intact and the
  test, not the product, was stale. Rather than drop the guard, it now follows
  the composition: the bar passes the logo props to MarketSwitcher, and
  MarketSwitcher renders MarketLogo.

95 -> 91 failures, 28 -> 25 files. tsc --noEmit clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
percolator-launch Ready Ready Preview, Comment Jul 21, 2026 4:14pm
percolator-mainnet Ready Ready Preview, Comment Jul 21, 2026 4:14pm
percolator-playground Ready Ready Preview, Comment Jul 21, 2026 4:14pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@dcccrypto, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 24cc1926-cf94-4f7f-9996-65c0161ddae0

📥 Commits

Reviewing files that changed from the base of the PR and between 309a181 and 24efb57.

📒 Files selected for processing (3)
  • app/__tests__/lib/priceStore-poll.test.ts
  • app/__tests__/lib/v17-matcher-state.test.ts
  • app/__tests__/unit/gh1654-market-info-bar-visibility.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pricestore-matcher-state-tests

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.

@dcccrypto

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@dcccrypto

Copy link
Copy Markdown
Owner Author

Closing as superseded — this landed upstream independently.

The test-maintenance batch merged into playground (now 8bab3ced) fixed the v17-matcher-state / gh1654 / priceStore-poll fixtures in 5d6f715 (test: complete stale mocks and retire two more orphaned suites).

Verified on the current base rather than assumed:

  • I ran the full suite on 8bab3ced alone. It is down to 14 failures / 4 files, and none of them are in this PR's target files — they pass on the base as-is.
  • Re-checked specifically for this PR's scope: nothing left for it to fix.
  • This branch now conflicts with playground for the same reason: upstream edited the very files it touches.

Rebasing it would produce a no-op at best, so closing rather than leaving a stale PR in the queue.

For what it's worth the remaining 14 failures are covered by the three PRs I'm keeping open: #2451 (useWallet + ConnectButton, 7), #2459 (Header nav, 4), #2458 (Portfolio PORT-007, 1). With those three stacked the suite is 2823 passed, 0 failed.

@dcccrypto dcccrypto closed this Jul 28, 2026
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