test: API endpoint coverage for revisions, schemas, audit, and auth #78

Closed
opened 2026-02-13 19:03:14 +00:00 by forbes · 0 comments
Owner

Ref: docs/ROADMAP.md § Appendix B / 1.4 Unit Test Suite

Existing API tests cover items (5 tests), BOM (6 tests), broker (7 tests), and server mode (6 tests). Major endpoint groups remain untested:

Revision endpoints:

  • GET /api/items/{pn}/revisions — list revisions
  • POST /api/items/{pn}/revisions — create revision
  • GET /api/items/{pn}/revisions/compare — diff two revisions
  • POST /api/items/{pn}/revisions/{rev}/rollback — rollback
  • PATCH /api/items/{pn}/revisions/{rev} — update status/labels

Schema endpoints:

  • GET /api/schemas — list schemas
  • GET /api/schemas/{name} — get schema detail

Audit endpoints:

  • GET /api/audit/completeness — completeness summary
  • GET /api/audit/completeness/{pn} — per-item scoring

Auth endpoints:

  • POST /api/auth/login — login flow
  • GET /api/auth/me — current user
  • POST /api/auth/tokens — create API token
  • DELETE /api/auth/tokens/{id} — revoke token

Existing test files:

  • internal/api/items_test.go (5 tests)
  • internal/api/bom_handlers_test.go (6 tests)
  • internal/api/broker_test.go (7 tests)
  • internal/api/servermode_test.go (6 tests)
**Ref:** `docs/ROADMAP.md` § Appendix B / 1.4 Unit Test Suite Existing API tests cover items (5 tests), BOM (6 tests), broker (7 tests), and server mode (6 tests). Major endpoint groups remain untested: **Revision endpoints:** - [ ] `GET /api/items/{pn}/revisions` — list revisions - [ ] `POST /api/items/{pn}/revisions` — create revision - [ ] `GET /api/items/{pn}/revisions/compare` — diff two revisions - [ ] `POST /api/items/{pn}/revisions/{rev}/rollback` — rollback - [ ] `PATCH /api/items/{pn}/revisions/{rev}` — update status/labels **Schema endpoints:** - [ ] `GET /api/schemas` — list schemas - [ ] `GET /api/schemas/{name}` — get schema detail **Audit endpoints:** - [ ] `GET /api/audit/completeness` — completeness summary - [ ] `GET /api/audit/completeness/{pn}` — per-item scoring **Auth endpoints:** - [ ] `POST /api/auth/login` — login flow - [ ] `GET /api/auth/me` — current user - [ ] `POST /api/auth/tokens` — create API token - [ ] `DELETE /api/auth/tokens/{id}` — revoke token **Existing test files:** - `internal/api/items_test.go` (5 tests) - `internal/api/bom_handlers_test.go` (6 tests) - `internal/api/broker_test.go` (7 tests) - `internal/api/servermode_test.go` (6 tests)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/silo#78