feat(platform): include no-data service status

This commit is contained in:
lingniu
2026-07-04 04:28:27 +08:00
parent 40397efa4a
commit 40b55600c7
4 changed files with 28 additions and 2 deletions

View File

@@ -326,6 +326,18 @@ func TestHandlerVehicleServiceSummaryEndpoint(t *testing.T) {
if len(body.Data.ServiceStatuses) == 0 || len(body.Data.Protocols) == 0 {
t.Fatalf("summary should expose service status and protocol distributions, got %+v", body.Data)
}
noDataStatusFound := false
for _, status := range body.Data.ServiceStatuses {
if status.Status == "no_data" {
noDataStatusFound = true
if status.Title != "暂无数据来源" || status.Count != body.Data.NoDataVehicles {
t.Fatalf("no_data service status should mirror noDataVehicles, got status=%+v summary=%+v", status, body.Data)
}
}
}
if !noDataStatusFound {
t.Fatalf("summary service status distribution should include no_data, got %+v", body.Data.ServiceStatuses)
}
}
func TestHandlerVehicleServiceOverviewsEndpoint(t *testing.T) {