--- # nuzlocke-tracker-ch77 title: Integration tests for Games & Routes API status: draft type: task created_at: 2026-02-10T09:33:13Z updated_at: 2026-02-10T09:33:13Z parent: nuzlocke-tracker-yzpb --- Write integration tests for the games and routes API endpoints in `backend/src/app/api/games.py`. ## Checklist - [ ] Test CRUD operations for games (create, list, get, update, delete) - [ ] Test route management within a game (create, list, reorder, update, delete) - [ ] Test route encounter management (add/remove Pokemon to routes) - [ ] Test bulk import functionality - [ ] Test region grouping/filtering - [ ] Test error cases (404 for missing games, validation errors, duplicate handling) ## Notes - Use the httpx AsyncClient fixture from the test infrastructure task - Each test should be independent — use fixtures to set up required data - Test both success and error response codes and bodies