test(frontend): cover BTC WalletConnect address events#13160
Draft
cursor[bot] wants to merge 2 commits into
Draft
test(frontend): cover BTC WalletConnect address events#13160cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
Co-authored-by: Antonio Ventilii <AntonioVentilii@users.noreply.github.com>
Co-authored-by: Antonio Ventilii <AntonioVentilii@users.noreply.github.com>
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.
Motivation
Recent BTC WalletConnect support added initial
bip122_addressesChangedevent emission after session approval, but the existing provider spec only asserted BTC namespace/session-property setup. That left a dApp-facing event path untested.Changes
src/frontend/src/tests/lib/providers/wallet-connect.providers.spec.tsfor emitting the initial BTCbip122_addressesChangedevent to active bip122 sessions.Risky behavior now covered: BTC WalletConnect session approval now has regression coverage for both the event that dApps listen to and the privacy/safety skip path when account metadata cannot be built.
Why this materially reduces regression risk: this event path is part of the BTC WalletConnect integration contract; without it, connected dApps may miss the wallet's BTC address even though the session approval succeeds.
Tests
npm run preparenpm run test -- src/frontend/src/tests/lib/providers/wallet-connect.providers.spec.tsnpx eslint --max-warnings 0 src/frontend/src/tests/lib/providers/wallet-connect.providers.spec.ts