Files
nuzlocke-tracker/.beans/nuzlocke-tracker-ee9s--unit-tests-for-frontend-utilities-and-hooks.md
Julian Tabel 6f4ed3460b Add Unit & Integration Tests epic with subtasks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 10:34:45 +01:00

1.2 KiB

title, status, type, created_at, updated_at, parent
title status type created_at updated_at parent
Unit tests for frontend utilities and hooks draft task 2026-02-10T09:33:38Z 2026-02-10T09:33:38Z nuzlocke-tracker-yzpb

Write unit tests for the frontend utility functions and custom React hooks.

Checklist

  • Test utils/formatEvolution.ts — evolution chain formatting logic
  • Test utils/download.ts — file download utility
  • Test hooks/useRuns.ts — run CRUD hook with mocked API
  • Test hooks/useGames.ts — game fetching hook
  • Test hooks/useEncounters.ts — encounter operations hook
  • Test hooks/usePokemon.ts — pokemon data hook
  • Test hooks/useGenlockes.ts — genlocke operations hook
  • Test hooks/useBosses.ts — boss operations hook
  • Test hooks/useStats.ts — stats fetching hook
  • Test hooks/useAdmin.ts — admin operations hook

Notes

  • Utility functions are pure functions — straightforward to test
  • Hooks wrap React Query — test that they call the right API endpoints, handle loading/error states, and invalidate queries correctly
  • Use @testing-library/react's renderHook for hook testing
  • Mock the API client (from src/api/) rather than individual fetch calls