Skip to content

Add unit tests for AED status state machine transitions #117

@vgpastor

Description

@vgpastor

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

  • All valid transitions tested
  • All invalid transitions tested
  • Edge cases covered
  • Tests pass with npm run test:unit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions