2026-02-10 10:34:45 +01:00
|
|
|
---
|
|
|
|
|
# nuzlocke-tracker-ch77
|
|
|
|
|
title: Integration tests for Games & Routes API
|
2026-02-21 12:51:37 +01:00
|
|
|
status: completed
|
2026-02-10 10:34:45 +01:00
|
|
|
type: task
|
2026-02-21 12:51:37 +01:00
|
|
|
priority: normal
|
2026-02-10 10:34:45 +01:00
|
|
|
created_at: 2026-02-10T09:33:13Z
|
2026-02-21 12:51:37 +01:00
|
|
|
updated_at: 2026-02-21T11:48:10Z
|
2026-02-10 10:34:45 +01:00
|
|
|
parent: nuzlocke-tracker-yzpb
|
|
|
|
|
---
|
|
|
|
|
|
2026-02-21 12:51:37 +01:00
|
|
|
Write integration tests for the games and routes API endpoints in backend/src/app/api/games.py.
|
2026-02-10 10:34:45 +01:00
|
|
|
|
2026-02-21 12:51:37 +01:00
|
|
|
## Key behaviors to test
|
2026-02-10 10:34:45 +01:00
|
|
|
|
2026-02-21 12:51:37 +01:00
|
|
|
- Game CRUD: create (201), list, get with routes, update, delete (204)
|
|
|
|
|
- Slug uniqueness enforced at create and update (409)
|
|
|
|
|
- 404 for missing games
|
|
|
|
|
- 422 for invalid request bodies
|
|
|
|
|
- Route operations require version_group_id on the game (need VersionGroup fixture via db_session)
|
|
|
|
|
- list_game_routes only returns routes with encounters (or parents of routes with encounters)
|
|
|
|
|
- Game detail (GET /{id}) returns all routes regardless
|
|
|
|
|
- Route create, update, delete, reorder
|
2026-02-10 10:34:45 +01:00
|
|
|
|
2026-02-21 12:51:37 +01:00
|
|
|
## Checklist
|
2026-02-10 10:34:45 +01:00
|
|
|
|
2026-02-21 12:51:37 +01:00
|
|
|
- [x] Test CRUD operations for games (create, list, get, update, delete)
|
|
|
|
|
- [x] Test route management within a game (create, list, update, delete, reorder)
|
|
|
|
|
- [x] Test error cases (404, 409 duplicate slug, 422 validation)
|
|
|
|
|
- [x] Test list_game_routes filtering behavior (empty routes excluded)
|
|
|
|
|
- [x] Test by-region endpoint structure
|