@@ -297,7 +297,8 @@ func TestIncidentDetailFieldsProjection(t *testing.T) {
297297 row ["images" ] = []map [string ]any {{"src" : strings .Repeat ("https://example.test/image/" , 100 )}}
298298 stub .data = row
299299
300- out , err := execCommand ("incident" , "detail" , "inc-1" , "--fields" , "incident_id,title,root_cause" , "--output-format" , "json" )
300+ fields := []string {"incident_id" , "title" , "incident_severity" , "progress" , "ai_summary" , "root_cause" , "resolution" , "alert_cnt" , "start_time" , "channel_id" }
301+ out , err := execCommand ("incident" , "detail" , "inc-1" , "--fields" , strings .Join (fields , "," ), "--output-format" , "json" )
301302 if err != nil {
302303 t .Fatalf ("execCommand: %v" , err )
303304 }
@@ -308,8 +309,13 @@ func TestIncidentDetailFieldsProjection(t *testing.T) {
308309 if err := json .Unmarshal ([]byte (strings .TrimSpace (out )), & detail ); err != nil {
309310 t .Fatalf ("parse projected detail json: %v\n %s" , err , out )
310311 }
311- if len (detail ) != 3 || detail ["incident_id" ] == nil || detail ["title" ] == nil || detail ["root_cause" ] == nil {
312- t .Fatalf ("projected detail = %v, want exactly incident_id,title,root_cause" , detail )
312+ if len (detail ) != len (fields ) {
313+ t .Fatalf ("projected detail keys = %v, want exactly %v" , detail , fields )
314+ }
315+ for _ , field := range fields {
316+ if detail [field ] == nil {
317+ t .Errorf ("projected detail missing %q: %v" , field , detail )
318+ }
313319 }
314320 if _ , ok := detail ["description" ]; ok {
315321 t .Errorf ("projected detail includes description: %v" , detail )
0 commit comments