Skip to content

test: cover useWallet connect and error states#604

Open
jakerated-r wants to merge 1 commit into
Commitlabs-Org:masterfrom
jakerated-r:feature/use-wallet-tests-590
Open

test: cover useWallet connect and error states#604
jakerated-r wants to merge 1 commit into
Commitlabs-Org:masterfrom
jakerated-r:feature/use-wallet-tests-590

Conversation

@jakerated-r

Copy link
Copy Markdown

Summary

  • Adds focused Vitest/React Testing Library coverage for src/hooks/useWallet.ts.
  • Mocks @stellar/freighter-api and covers mount auto-detect, connect success after an error, returned error results, thrown exceptions, disconnect reset, and empty Freighter responses.

Closes #590

Tests

  • npm test -- --run src/hooks/__tests__/useWallet.test.ts (6 passed)
  • git diff --check
  • npm test -- --run currently fails on existing unrelated repository issues, including duplicate declarations in src/lib/backend/services/contracts.ts, src/lib/backend/validation.ts, and src/lib/backend/auditLog.ts; malformed JSX in src/components/modals/CommitmentDetailsModal.tsx; missing @testing-library/user-event; jest used in a Vitest test; and tests missing a DOM environment. This PR does not touch those files.

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

@jakerated-r is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

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