Add unit tests for services layer

36 tests covering build_families (linear chains, branching, disjoint,
Shedinja case), resolve_base_form, to_roman (parametrized), and
strip_roman_suffix including round-trip verification.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-21 13:05:24 +01:00
parent d6a0b60585
commit ca736e0f39
2 changed files with 184 additions and 6 deletions

View File

@@ -1,10 +1,11 @@
---
# nuzlocke-tracker-iam7
title: Unit tests for services layer
status: draft
status: completed
type: task
priority: normal
created_at: 2026-02-10T09:33:08Z
updated_at: 2026-02-10T09:33:08Z
updated_at: 2026-02-21T12:01:23Z
parent: nuzlocke-tracker-yzpb
---
@@ -12,10 +13,13 @@ Write unit tests for the business logic in `backend/src/app/services/`. Currentl
## Checklist
- [ ] Test family resolution with simple linear evolution chains (e.g. A → B → C)
- [ ] Test family resolution with branching evolutions (e.g. Eevee)
- [ ] Test family resolution with region-specific evolutions
- [ ] Test edge cases: single-stage Pokemon, circular references (if possible), missing data
- [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 1100, genlocke sequence IV
- [x] Test strip_roman_suffix: II/III/IV/X, no suffix, round-trip with to_roman
## Notes