Skip to content

test(assets-controller): add ws price-update snapshot source of truth tests - #10543

Merged
Prithpal-Sooriya merged 1 commit into
mainfrom
feature/use-memory-add-snaps-ynd
Sep 29, 2026
Merged

Prithpal-Sooriya merged 1 commit into
mainfrom
feature/use-memory-add-snaps-ynd

Conversation

@Prithpal-Sooriya

@Prithpal-Sooriya Prithpal-Sooriya commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

Adds the single main-path snapshot (source of truth) test to each websocket price-update integration suite from #10476, mirroring how the BNB Chain spam-token v6 suites capture theirs (#10490, later trimmed to one main-path snapshot per suite):

  • pipeline/buildWsUpdateSources.price-updates.integration.test.ts — a fresh default-lane pass (v5, empty wallet, ETH held and USDC acquired in one websocket event) is captured end-to-end via withZeroedTimestamps(response).
  • AssetsController.ws-price-updates.integration.test.ts — the same scenario booted through the real controller, capturing the settled full state via withZeroedTimestamps(state).

Each suite gets exactly one snapshot (the main path), placed as a sibling of the brand-new-holdings describe.each and running its default-scenario helper from scratch rather than a beforeAll-cached result — the shape the bsc-spam v6 suites settled on after trimming.

The snapshots capture the full response/state surfaces (balances, metadata, prices, detected assets) with lastUpdated zeroed, so any future regression in the websocket enrichment pipeline surfaces as a snapshot diff for review.

Test-only change — no consumer-facing behavior change, so no changelog entry (carrying the no-changelog label).

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Test-only additions with no production code or runtime behavior changes.

Overview
Adds one main-path Jest snapshot test to each websocket price-update integration suite, following the same “source of truth” pattern used for the BNB Chain spam-token v6 suites.

Each new generates snapshot (source of truth) case re-runs the default happy path (empty wallet, single websocket event with ETH + USDC) independently—not from a shared beforeAll—and asserts against a snapshot after withZeroedTimestamps so volatile lastUpdated fields do not flake. The pipeline suite snapshots the enriched DataResponse; the AssetsController suite snapshots the settled full controller state (balances, metadata, prices, preferences, etc.).

Committed snapshot files capture the expected shapes so future regressions in websocket enrichment show up as reviewable diffs.

Reviewed by Cursor Bugbot for commit 8db7235. Bugbot is set up for automated code reviews on this repo. Configure here.

… tests

Adds a single main-path snapshot to each websocket price-update
integration suite, mirroring the bsc-spam v6 suites: the default lane
(fresh wallet, ETH held and USDC acquired in one websocket event) is
captured end-to-end with zeroed timestamps.
@Prithpal-Sooriya
Prithpal-Sooriya added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit 96f2c5b Sep 29, 2026
59 checks passed
@Prithpal-Sooriya
Prithpal-Sooriya deleted the feature/use-memory-add-snaps-ynd branch September 29, 2026 09:43

This branch was successfully deployed

1 active deployment
default-branch — 8db7235b Deployed Sep 28, 2026 by Prithpal-Sooriya via Determine whether this PR is a release PR #4814
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants