feat(platform): expose coverage service status

This commit is contained in:
lingniu
2026-07-04 02:03:12 +08:00
parent 5d401a8f0b
commit 526377c13f
9 changed files with 94 additions and 13 deletions

View File

@@ -50,6 +50,18 @@ func TestHandlerVehicleCoverage(t *testing.T) {
t.Fatalf("response missing %q: %s", want, rec.Body.String())
}
}
var body struct {
Data Page[VehicleCoverageRow] `json:"data"`
}
if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil {
t.Fatalf("response JSON should decode: %v body=%s", err, rec.Body.String())
}
if len(body.Data.Items) == 0 || body.Data.Items[0].ServiceStatus == nil {
t.Fatalf("coverage row should include canonical vehicle service status: %s", rec.Body.String())
}
if body.Data.Items[0].ServiceStatus.Status != "degraded" {
t.Fatalf("coverage row should expose degraded status, got %+v", body.Data.Items[0].ServiceStatus)
}
}
func TestHandlerVehicleCoverageFiltersServiceStatus(t *testing.T) {