feat(platform): include no-data service status
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user