Skip to content

test: cover useWallet Freighter state paths#607

Closed
BowenMilner wants to merge 1 commit into
Commitlabs-Org:masterfrom
BowenMilner:use-wallet-hook-tests-590
Closed

test: cover useWallet Freighter state paths#607
BowenMilner wants to merge 1 commit into
Commitlabs-Org:masterfrom
BowenMilner:use-wallet-hook-tests-590

Conversation

@BowenMilner

Copy link
Copy Markdown

Closes #590.

Summary

  • add RTL/Vitest coverage for useWallet
  • mock @stellar/freighter-api getAddress across connected, disconnected, error, thrown exception, and repeated connect scenarios
  • verify mount auto-detection, connect, disconnect, and state clearing behavior

Validation

  • npm test -- src/hooks/__tests__/useWallet.test.tsx
  • npm run test:coverage -- src/hooks/__tests__/useWallet.test.tsx --coverage.include=src/hooks/useWallet.ts
    • useWallet.ts: 100% statements, branches, functions, and lines
  • npx eslint src/hooks/useWallet.ts src/hooks/__tests__/useWallet.test.tsx
  • git diff --check

Note: npm run lint still fails on existing unrelated repo issues outside this change, including parse errors in src/app/api/commitments/[id]/settle/route.ts and src/components/modals/CommitmentDetailsModal.tsx.

Payment details can be provided privately if this is accepted.

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

@BowenMilner

Copy link
Copy Markdown
Author

Closing this as a duplicate after noticing #604 was already submitted for #590. I missed the issue comment during my initial check; sorry for the noise.

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 RTL tests for the useWallet hook covering Freighter connect, disconnect, and error paths

1 participant