Files
nuzlocke-tracker/.beans/nuzlocke-tracker-ch77--integration-tests-for-games-routes-api.md
Julian Tabel 79eabf4f9f Add integration tests for Games & Routes API
25 tests covering game CRUD (create/list/get/update/delete), slug
uniqueness enforcement, by-region grouping, and route operations
(create/update/delete/reorder). Verifies that list_game_routes
excludes routes with no Pokemon encounters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:51:37 +01:00

1.1 KiB

title, status, type, priority, created_at, updated_at, parent
title status type priority created_at updated_at parent
Integration tests for Games & Routes API completed task normal 2026-02-10T09:33:13Z 2026-02-21T11:48:10Z nuzlocke-tracker-yzpb

Write integration tests for the games and routes API endpoints in backend/src/app/api/games.py.

Key behaviors to test

  • 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

Checklist

  • Test CRUD operations for games (create, list, get, update, delete)
  • Test route management within a game (create, list, update, delete, reorder)
  • Test error cases (404, 409 duplicate slug, 422 validation)
  • Test list_game_routes filtering behavior (empty routes excluded)
  • Test by-region endpoint structure