28 tests covering run CRUD, rules JSONB storage, encounter creation, route-lock enforcement, shinyClause and giftClause bypasses, status transitions (complete/fail), and encounter update/delete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
title, status, type, priority, created_at, updated_at, parent
| title | status | type | priority | created_at | updated_at | parent |
|---|---|---|---|---|---|---|
| Integration tests for Runs & Encounters API | completed | task | normal | 2026-02-10T09:33:21Z | 2026-02-21T11:54:42Z | nuzlocke-tracker-yzpb |
Write integration tests for the core run tracking and encounter API endpoints. This is the heart of the application.
Checklist
- Test run CRUD operations (create, list, get, update, delete)
- Test run creation with rules configuration (JSONB field)
- Test encounter logging on a run (create encounter on a route)
- Test encounter status changes (alive → dead, faintLevel, deathCause)
- Test route-lock enforcement (duplicate sibling encounter → 409)
- Test shiny encounter handling (shinyClause bypasses route-lock)
- Test gift clause bypass (giftClause=true, origin=gift bypasses route-lock)
- Test ending a run (completion/failure, completed_at set, 400 on double-end)
- Test error cases (404 for invalid run/route/pokemon, 400 for parent route, 422 for missing fields)
Notes
- Run endpoints:
backend/src/app/api/runs.py - Encounter endpoints:
backend/src/app/api/encounters.py - This is the most critical area — Nuzlocke rules enforcement should be thoroughly tested
- Tests need game + pokemon + route fixtures as prerequisites