test(assets-controller): add ws price-update snapshot source of truth tests - #10543
Merged
Merged
Conversation
… 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.
salimtb
approved these changes
Sep 29, 2026
This branch was successfully deployed
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.
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 viawithZeroedTimestamps(response).AssetsController.ws-price-updates.integration.test.ts— the same scenario booted through the real controller, capturing the settled full state viawithZeroedTimestamps(state).Each suite gets exactly one snapshot (the main path), placed as a sibling of the brand-new-holdings
describe.eachand running its default-scenario helper from scratch rather than abeforeAll-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
lastUpdatedzeroed, 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-changeloglabel).References
Checklist
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 sharedbeforeAll—and asserts against a snapshot afterwithZeroedTimestampsso volatilelastUpdatedfields do not flake. The pipeline suite snapshots the enrichedDataResponse; theAssetsControllersuite 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.