Skip to content

test(serve): add endpoint tests for edda-serve HTTP handlers #374

@fagemx

Description

@fagemx

Problem

edda-serve has 8,722 lines of code with 12+ HTTP endpoints but only 1 test. All endpoint logic (validation, error mapping, query param parsing, auth middleware) is untested at the HTTP layer.

Current test distribution shows the gap:

Crate Tests
edda-bridge-claude 525
edda-core 163
edda-ledger 159
edda-serve 1

Scope

Add at minimum one happy-path + one error-case test for each endpoint group:

  • Decision endpoints (status, context, list, batch, outcomes, chain)
  • Draft endpoints (GET/POST, approve/deny)
  • Event recording (note, decide)
  • Telemetry (ingest, stats)
  • Snapshots & patterns
  • Analytics (recap, overview)
  • Metrics & quality
  • Auth & device pairing
  • Ingestion endpoints

Notes

  • Use axum::test or tower::ServiceExt for handler testing
  • Existing test pattern in the file can be extended
  • edda-ledger tests cover storage logic; these tests should focus on HTTP-layer behavior (status codes, validation, serialization)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions