Context
The AED status state machine in src/lib/aed-status.ts validates transitions between statuses (DRAFT → PENDING_REVIEW → PUBLISHED → INACTIVE, etc.) but lacks comprehensive unit test coverage.
What needs to happen
- Write unit tests for
validateStatusTransition() covering all valid transitions
- Test that invalid transitions are rejected
- Test edge cases (same status → same status, null inputs)
Where to look
src/lib/aed-status.ts — The state machine implementation
tests/unit/ — Where tests go
Tech
- Vitest (not Jest)
- Follow AAA pattern (Arrange → Act → Assert)
- Test naming:
should[ExpectedBehavior]When[Condition]
Acceptance criteria
Context
The AED status state machine in
src/lib/aed-status.tsvalidates transitions between statuses (DRAFT → PENDING_REVIEW → PUBLISHED → INACTIVE, etc.) but lacks comprehensive unit test coverage.What needs to happen
validateStatusTransition()covering all valid transitionsWhere to look
src/lib/aed-status.ts— The state machine implementationtests/unit/— Where tests goTech
should[ExpectedBehavior]When[Condition]Acceptance criteria
npm run test:unit