You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useTransactionQuery has no tests: query state and refetch logic is uncovered
Labels / Complexity: testing · Medium Complexity — Medium
Problem
useTransactionQuery (src/hooks/useTransactionQuery.ts) wraps transaction data fetching with loading/error/refetch state. It has no tests. A regression that drops the error state or breaks refetch ships silently in every screen that lists transactions.
Why this is architecturally hard
Query state is the test design. Tests must pin loading → data, loading → error, and refetch transitions with a stubbed fetcher.
The data source is the mock (i add sample readme #9). Tests written now should assert against the current fetch contract so the mock-to-real migration cannot silently change the hook's behavior.
Acceptance criteria
Tests cover loading, success, error, and refetch states with a stubbed fetcher.
useTransactionQuery has no tests: query state and refetch logic is uncovered
Labels / Complexity: testing · Medium Complexity — Medium
Problem
useTransactionQuery(src/hooks/useTransactionQuery.ts) wraps transaction data fetching with loading/error/refetch state. It has no tests. A regression that drops the error state or breaks refetch ships silently in every screen that lists transactions.Why this is architecturally hard
Acceptance criteria
npm test.Out of scope
The transactions API mock (#9); other hooks.
Getting started
src/hooks/useTransactionQuery.ts— the hooksrc/hooks/__tests__/useToast.test.ts— the patternCommands:
npm test.Good first files to read:
src/hooks/useTransactionQuery.ts.