@@ -427,6 +427,35 @@ describe("FlowRunDetailsPage", () => {
427427 expect ( screen . queryByTestId ( "flow-run-graph" ) ) . not . toBeInTheDocument ( ) ;
428428 } ) ;
429429
430+ it . each ( [
431+ "Submitting" ,
432+ "InfrastructurePending" ,
433+ ] as const ) ( "hides FlowRunGraph when flow run state is %s" , async ( stateName ) => {
434+ const pendingFlowRun = createFakeFlowRun ( {
435+ name : `${ stateName } -flow-run` ,
436+ state_type : "PENDING" ,
437+ state_name : stateName ,
438+ state : createFakeState ( {
439+ type : "PENDING" ,
440+ name : stateName ,
441+ } ) ,
442+ } ) ;
443+
444+ server . use (
445+ http . get ( buildApiUrl ( "/flow_runs/:id" ) , ( ) => {
446+ return HttpResponse . json ( pendingFlowRun ) ;
447+ } ) ,
448+ ) ;
449+
450+ renderFlowRunDetailsPage ( ) ;
451+
452+ await waitFor ( ( ) => {
453+ expect ( screen . getByText ( `${ stateName } -flow-run` ) ) . toBeInTheDocument ( ) ;
454+ } ) ;
455+
456+ expect ( screen . queryByTestId ( "flow-run-graph" ) ) . not . toBeInTheDocument ( ) ;
457+ } ) ;
458+
430459 it ( "hides FlowRunGraph and execution tabs when flow run state is SCHEDULED" , async ( ) => {
431460 const scheduledFlowRun = createFakeFlowRun ( {
432461 name : "scheduled-flow-run" ,
@@ -525,6 +554,45 @@ describe("FlowRunDetailsPage", () => {
525554 ) . not . toBeInTheDocument ( ) ;
526555 } ) ;
527556
557+ it . each ( [
558+ "Submitting" ,
559+ "InfrastructurePending" ,
560+ ] as const ) ( "hides execution tabs for %s flow runs" , async ( stateName ) => {
561+ const pendingFlowRun = createFakeFlowRun ( {
562+ name : `${ stateName } -tabs-flow-run` ,
563+ state_type : "PENDING" ,
564+ state_name : stateName ,
565+ state : createFakeState ( {
566+ type : "PENDING" ,
567+ name : stateName ,
568+ } ) ,
569+ } ) ;
570+
571+ server . use (
572+ http . get ( buildApiUrl ( "/flow_runs/:id" ) , ( ) => {
573+ return HttpResponse . json ( pendingFlowRun ) ;
574+ } ) ,
575+ ) ;
576+
577+ renderFlowRunDetailsPage ( ) ;
578+
579+ await waitFor ( ( ) => {
580+ expect (
581+ screen . getByText ( `${ stateName } -tabs-flow-run` ) ,
582+ ) . toBeInTheDocument ( ) ;
583+ } ) ;
584+
585+ expect (
586+ screen . queryByRole ( "tab" , { name : "Task Runs" } ) ,
587+ ) . not . toBeInTheDocument ( ) ;
588+ expect (
589+ screen . queryByRole ( "tab" , { name : "Subflow Runs" } ) ,
590+ ) . not . toBeInTheDocument ( ) ;
591+ expect (
592+ screen . queryByRole ( "tab" , { name : "Artifacts" } ) ,
593+ ) . not . toBeInTheDocument ( ) ;
594+ } ) ;
595+
528596 it ( "renders FlowRunGraph for FAILED flow runs" , async ( ) => {
529597 const failedFlowRun = createFakeFlowRun ( {
530598 name : "failed-flow-run" ,
0 commit comments