test(wallet): add full useStellarWallet hook coverage (#68) - #1
Closed
benzy018 wants to merge 1 commit into
Closed
Conversation
Extend the useStellarWallet tests to cover every acceptance criterion from ecotask-network#68: Freighter connect (success, extension missing, not unlocked), Lobstr connect (success, not installed, signing cancelled), import (valid and invalid secret keys), disconnectWallet clearing the vault, and balance/token refresh success and failure paths. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Owner
Author
|
Superseded by ecotask-network#118 (this repo is a fork; CI runs on the upstream and the issue ecotask-network#68 lives there). |
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.
Description
Closes ecotask-network#68
Adds comprehensive test coverage for
src/hooks/useStellarWallet.ts, the primary interface between the app and the Stellar blockchain (Freighter connection, Lobstr deep-link, in-app wallet creation, import, balance refresh, and disconnection).Extends the existing
src/__tests__/useStellarWallet.test.tsx(which covered connect-rollback on balance-fetch failure) with the remaining acceptance criteria:Mocks used:
stellar.ts(getBalance, getTokenBalance, createTestnetAccount, isValidSecretKey, getPublicKeyFromSecret, Keypair, TransactionBuilder),lobstr.ts(isLobstrInstalled, openLobstrForSigning),walletVault.ts(via mocked MMKV), and the ZustanduseWalletStore.Type of Change
How Has This Been Tested?
Verified:
npm test(42 suites, 373 tests pass),npm run typecheck,npx eslint src/__tests__/useStellarWallet.test.tsx— all green.Checklist