Skip to content

Expand web test coverage for wallet flows dashboard mapping and analytics route - #218

Open
Purity-Euphemia wants to merge 4 commits into
Zyntarivoid:mainfrom
Purity-Euphemia:Expand-web-test-coverage-for-wallet-flows-dashboard-mapping-and-analytics-route
Open

Expand web test coverage for wallet flows dashboard mapping and analytics route#218
Purity-Euphemia wants to merge 4 commits into
Zyntarivoid:mainfrom
Purity-Euphemia:Expand-web-test-coverage-for-wallet-flows-dashboard-mapping-and-analytics-route

Conversation

@Purity-Euphemia

Copy link
Copy Markdown

Closes #195 # PR 204: Expand web test coverage for wallet flows, dashboard mapping, and analytics routes

This PR adds focused test coverage for key web logic in the VeilLend web app. It improves confidence around wallet connection flows, dashboard data mapping, and campaign analytics route behavior.

What's included

  • Added a new hook test for useStellarWallet to verify:
    • wallet initialization state
    • successful Freighter connection and auth session creation
    • disconnect behavior and auth session cleanup
    • connect failure handling
  • Extended WalletConnect coverage to verify:
    • Freighter install prompt when the wallet extension is missing
    • connect button disabled state during loading
  • Expanded dashboard mapping coverage in fetchDashboardData to validate:
    • empty indexer responses
    • portfolio totals and activity mapping
  • Added analytics behavior coverage for trackCampaignEvent fallback path when navigator.sendBeacon is unavailable
  • Hardened the analytics helper to safely handle a non-promise fetch fallback

Files changed

  • veilend-web/src/__tests__/useStellarWallet.test.tsx
  • veilend-web/src/__tests__/wallet.test.tsx
  • veilend-web/src/__tests__/dashboardData.test.ts
  • veilend-web/src/__tests__/campaignAnalytics.test.ts
  • veilend-web/src/lib/campaignAnalytics.ts

Test validation

Run the following in the veilend-web workspace:

cd veilend-web
npm test -- --run src/__tests__/wallet.test.tsx src/__tests__/dashboardData.test.ts src/__tests__/campaignAnalytics.test.ts src/__tests__/useStellarWallet.test.tsx

Result: 21 passed across the targeted test files.

@Cedarich

Copy link
Copy Markdown
Contributor

@Purity-Euphemia

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.

24. Expand web test coverage for wallet flows, dashboard mapping, and analytics routes

2 participants