Skip to content

test: add Jest tests for walletService#152

Merged
Smartdevs17 merged 1 commit intoSmartdevs17:mainfrom
internet-dot:fix/issue-14
Mar 27, 2026
Merged

test: add Jest tests for walletService#152
Smartdevs17 merged 1 commit intoSmartdevs17:mainfrom
internet-dot:fix/issue-14

Conversation

@internet-dot
Copy link
Copy Markdown
Contributor

Summary

Adds comprehensive Jest unit tests for walletService.ts.

Tests added

  • Singleton: getInstance returns same instance
  • Connection management: setConnection, getConnection, addListener, removeListener, isConnected
  • disconnectWallet: clears connection and notifies listeners
  • initialize: resolves without error
  • getTokenBalances: native balance for ETH/MATIC/Arbitrum, USDC inclusion/skip/error handling, provider failure
  • estimateGas: valid estimate, provider failure
  • getWalletSigner: throws when no connection or no eip1193Provider
  • createSuperfluidStream: user rejection (code 4001, ACTION_REJECTED), SFError formatting
  • estimateSuperfluidCreateFlow: network mismatch
  • createSablierStream: user denied via message text

All external dependencies (ethers, superfluid SDK, contracts, config) are mocked.

Fixes #14

@Smartdevs17 Smartdevs17 merged commit 172c046 into Smartdevs17:main Mar 27, 2026
1 check 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.

🧪 Add Jest tests for walletService

2 participants