feat(platform): expose service status on vehicle rows
This commit is contained in:
@@ -35,6 +35,18 @@ func TestHandlerVehicles(t *testing.T) {
|
||||
if !strings.Contains(rec.Body.String(), "LB9A32A24R0LS1426") {
|
||||
t.Fatalf("response missing vehicle: %s", rec.Body.String())
|
||||
}
|
||||
var body struct {
|
||||
Data Page[VehicleRow] `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("vehicle row should include canonical vehicle service status: %s", rec.Body.String())
|
||||
}
|
||||
if body.Data.Items[0].ServiceStatus.Status != "degraded" {
|
||||
t.Fatalf("vehicle row should expose degraded status, got %+v", body.Data.Items[0].ServiceStatus)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandlerVehicleCoverage(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user