Skip to content

test(wallet): cover useWalletWatcher account/network change handling - #460

Merged
DeFiVC merged 2 commits into
ChainLearnOfficial:mainfrom
codemagician1949:test/wallet-watcher-358
Sep 27, 2026
Merged

DeFiVC merged 2 commits into
ChainLearnOfficial:mainfrom
codemagician1949:test/wallet-watcher-358

Conversation

@codemagician1949

Copy link
Copy Markdown
Contributor

#358 asks for Freighter account/network change listeners that update the auth store and notify the user. That is already implemented (watchWalletChanges in lib/stellar/wallet.ts plus the useWalletWatcher hook), but nothing tested it. Adds use-wallet-watcher.test.tsx covering: no watcher while disconnected, account change (toast + disconnect), network change (store update + toast), an unchanged report being ignored, and the watcher being stopped on unmount. npx vitest run src/lib/hooks/use-wallet-watcher.test.tsx: 5/5 passing. No production code changed.

To be completed (not part of this PR, not closed by it)

Closes #358

@netlify

netlify Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for chainlearn failed.

Name Link
🔨 Latest commit 44f0451
🔍 Latest deploy log https://app.netlify.com/projects/chainlearn/deploys/6ab9030ca1c1eb0009b769f7

@DeFiVC
DeFiVC merged commit bbedad3 into ChainLearnOfficial:main Sep 27, 2026
0 of 4 checks passed
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.

9. Add lib/stellar/wallet.ts Freighter event listeners

2 participants