Skip to content

[Testing] Unit-test the data and contract hooks and stores, wire a coverage gate #6

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

There are only a handful of unit tests for roughly 130 source files, and the most failure-prone logic (transaction build and submit hooks, the wallet and user stores) has none. Without coverage these regress silently. This is the safety net the rest of the frontend work needs.

Acceptance criteria

  • Add unit tests for useApi, useContractMutation, useConfirmedMutation, useTransactionPreview, and useRepaymentOperation
  • Add store tests for useWalletStore and useUserStore covering connect, switch, disconnect, and error paths
  • Mock the Stellar SDK and fetch so tests are deterministic and offline
  • Enable Jest coverage with a sensible initial threshold (ratchet, do not lower) and run it in CI

Files to touch

  • src/app/hooks/*.ts
  • src/app/stores/*.ts
  • jest.config.js (coverage config and thresholds)

Out of scope

  • E2E flows (tracked separately)
  • Visual regression

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignenhancementNew feature or requesthardAdvanced / high-difficulty issuehelp wantedExtra attention is needed

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions