Skip to Content
TestingStrategy

Testing Strategy

LayerWhat we testWhy
HTTP adapters (fetchWrapper*)Headers, token, FormData vs JSON, error mappingCatch auth/network bugs once
Services (lib/actions/*)Map API → typed shapes, pagination mapping, error propagation, small transformsMost defects live here
Data hooks (Query)Initial fetch, infinite pagination, invalidation after mutation, enabled/disabled flagsProves our caching behavior
StoresReducer/action transitions onlyFast unit checks
E2E (Playwright)4–6 CEO demo flowsSystem‑level confidence

First 10 tests

  1. handleResponse throws typed error with statusCode/details.
  2. Posts list service returns PageResult + hasNextPage.
  3. Posts service coerces latLong strings → numbers (transform).
  4. usePostsInfinite flattens pages; fetchNextPage appends.
  5. useMutationEx invalidates configured keys.
  6. jobPostingListStore actions (append/update/delete).
  7. Lists service: create/patch/delete happy path + 409 handling.
  8. Chat createRoom surfaces 409 (UI can open dialog).
  9. useDebouncedValue respects delay.
  10. E2E: Login → Create Job Post → appears in list.

CI gates

  • On PR: typecheck, lint, unit+integration, Playwright smoke (1–2 CUJs).
  • Nightly: full Playwright on staging.

Review checklist

  • Test added at correct seam (adapter/service/hook/store/E2E).
  • Mutation invalidates correct keys.
  • No server data put into a store.
  • URL state for shareable filters/sort/page.
Last updated on