fix(platform): clarify vehicle service status labels

This commit is contained in:
lingniu
2026-07-04 05:52:11 +08:00
parent 6229f837a0
commit bf17c7437e
9 changed files with 32 additions and 26 deletions

View File

@@ -159,6 +159,9 @@ func TestHandlerVehicleCoverageTreatsMissingCanonicalSourceAsDegraded(t *testing
if row.ServiceStatus == nil || row.ServiceStatus.Status != "degraded" {
t.Fatalf("missing canonical source should degrade vehicle service, got row=%+v body=%s", row, rec.Body.String())
}
if row.ServiceStatus.Title != "来源不完整" {
t.Fatalf("missing canonical source should use explicit incomplete-source title, got row=%+v body=%s", row, rec.Body.String())
}
}
}
@@ -410,6 +413,9 @@ func TestHandlerVehicleServiceSummaryEndpoint(t *testing.T) {
}
noDataStatusFound := false
for _, status := range body.Data.ServiceStatuses {
if status.Status == "degraded" && status.Title != "来源异常" {
t.Fatalf("summary degraded status should use broad source exception title, got %+v", status)
}
if status.Status == "no_data" {
noDataStatusFound = true
if status.Title != "暂无数据来源" || status.Count != body.Data.NoDataVehicles {