2026-02-10 10:34:45 +01:00
---
# nuzlocke-tracker-iam7
title: Unit tests for services layer
2026-02-21 13:05:24 +01:00
status: completed
2026-02-10 10:34:45 +01:00
type: task
2026-02-21 13:05:24 +01:00
priority: normal
2026-02-10 10:34:45 +01:00
created_at: 2026-02-10T09:33:08Z
2026-02-21 13:05:24 +01:00
updated_at: 2026-02-21T12:01:23Z
2026-02-10 10:34:45 +01:00
parent: nuzlocke-tracker-yzpb
---
Write unit tests for the business logic in `backend/src/app/services/` . Currently this is the `families.py` service which handles Pokemon evolution family resolution.
## Checklist
2026-02-21 13:05:24 +01:00
- [x] Test family resolution with simple linear evolution chains (e.g. A → B → C)
- [x] Test family resolution with branching evolutions (e.g. Eevee / Shedinja)
- [x] Test disjoint chains remain separate families
- [x] Test edge cases: empty list, single-stage Pokemon, base form, middle form
- [x] Test resolve_base_form: linear, branching, Shedinja, not-in-any-evolution
- [x] Test to_roman: parametrized 1– 100, genlocke sequence I– V
- [x] Test strip_roman_suffix: II/III/IV/X, no suffix, round-trip with to_roman
2026-02-10 10:34:45 +01:00
## Notes
- `services/families.py` contains the core logic for resolving Pokemon evolution families
- These tests may need mock database sessions or in-memory data depending on how the service queries data
- If the service methods take a DB session, mock it; if they operate on data objects, pass test data directly