Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Labels: backend, testing, Stellar Wave
The admin indexer routes have no route-level test, so their auth and validation go unverified.
tests/integration/admin-metrics.test.ts mocks indexerService and only hits GET /metrics. The handlers in admin.routes.ts:176-249 (status, reset, replay), including the check that a missing or negative ledger returns 400 and that reset/replay return ok/202, are never driven through the router. That leaves auth, validation and status codes on these operational endpoints untested.
What the fix has to hold to
- the tests go through the actual router, not around it
- auth (requireAdmin), validation and status codes are all asserted
Done when
Where to start
backend/tests/integration/admin-metrics.test.ts, referencing backend/src/routes/v1/admin.routes.ts. Re-testing the metrics aggregation that's already covered is out of scope. Follow the existing mock setup in that file.
Labels:
backend,testing,Stellar WaveThe admin indexer routes have no route-level test, so their auth and validation go unverified.
tests/integration/admin-metrics.test.tsmocks indexerService and only hitsGET /metrics. The handlers inadmin.routes.ts:176-249(status, reset, replay), including the check that a missing or negative ledger returns 400 and that reset/replay return ok/202, are never driven through the router. That leaves auth, validation and status codes on these operational endpoints untested.What the fix has to hold to
Done when
GET /status,POST /reset,POST /replayWhere to start
backend/tests/integration/admin-metrics.test.ts, referencingbackend/src/routes/v1/admin.routes.ts. Re-testing the metrics aggregation that's already covered is out of scope. Follow the existing mock setup in that file.