Skip to content

test(web): cover wallet connection error states for Freighter not installed and user rejection#243

Merged
K1NGD4VID merged 2 commits into
TrusTrove:mainfrom
brodapeethar:test/wallet-connection-error-states
Jul 5, 2026
Merged

test(web): cover wallet connection error states for Freighter not installed and user rejection#243
K1NGD4VID merged 2 commits into
TrusTrove:mainfrom
brodapeethar:test/wallet-connection-error-states

Conversation

@brodapeethar

Copy link
Copy Markdown
Contributor

Description

This PR adds targeted test coverage for wallet connection error states in useWallet.test.ts, addressing Issue #217. The tests cover two specific scenarios that were previously untested:

  1. Freighter not installed — Verifies the hook correctly surfaces the "Freighter wallet is not installed" error message (matching the actual freighter.ts implementation) and transitions to a disconnected state with a null address.

  2. User rejected access — Verifies the hook correctly surfaces the "User rejected access" error message (matching the Freighter API behavior) and transitions to a disconnected state with a null address.

Changes

File Change
apps/web/hooks/useWallet.test.ts Replaced the generic connectWallet fails test with two focused, well-named test cases that each verify the error message, connected state, and address nullification after failure

Testing

All 5 tests in useWallet.test.ts pass:

  • initial state
  • connectWallet succeeds
  • connectWallet handles Freighter not installed error ✓ (new)
  • connectWallet handles user rejection error ✓ (new)
  • disconnectWallet works

Related Issues

Closes #217

…installed and user rejection

- Replace generic connectWallet fails test with two specific error scenarios

- Add connectWallet handles Freighter not installed error test verifying error message, disconnected state, and null address

- Add connectWallet handles user rejection error test with the same assertions

- Error messages match actual freighter.ts implementation (Freighter wallet is not installed) and Freighter API behavior (User rejected access)
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@brodapeethar is attempting to deploy a commit to the K1NGD4VID Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@brodapeethar Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@K1NGD4VID

Copy link
Copy Markdown
Contributor

Resolve the COnflict @brodapeethar

@brodapeethar

Copy link
Copy Markdown
Contributor Author

@K1NGD4VID conflict resolved

@K1NGD4VID K1NGD4VID merged commit ea4af55 into TrusTrove:main Jul 5, 2026
1 check failed
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.

Integration Tests for Wallet Connection Failures

2 participants