@@ -474,27 +474,59 @@ describe("printCronList", () => {
474474 ) ;
475475
476476 it . each ( [
477- { label : "disabled" , enabled : false , runStatus : "ok" as const , expectedStatus : "disabled" } ,
478- { label : "running" , enabled : true , runStatus : "ok" as const , expectedStatus : "running" } ,
479- { label : "failed" , enabled : true , runStatus : "error" as const , expectedStatus : "error" } ,
477+ {
478+ label : "disabled" ,
479+ enabled : false ,
480+ running : false ,
481+ runStatus : "ok" as const ,
482+ expectedStatus : "disabled" ,
483+ } ,
484+ {
485+ label : "running" ,
486+ enabled : true ,
487+ running : true ,
488+ runStatus : "ok" as const ,
489+ expectedStatus : "running" ,
490+ } ,
491+ {
492+ label : "paused but force-running" ,
493+ enabled : false ,
494+ running : true ,
495+ runStatus : "ok" as const ,
496+ expectedStatus : "running" ,
497+ } ,
498+ {
499+ label : "failed" ,
500+ enabled : true ,
501+ running : false ,
502+ runStatus : "error" as const ,
503+ expectedStatus : "error" ,
504+ } ,
480505 ] ) (
481506 "does not let prior non-delivery override a $label automation" ,
482- ( { enabled, runStatus, expectedStatus } ) => {
507+ ( { enabled, running , runStatus, expectedStatus } ) => {
483508 const job = createBaseJob ( {
484509 enabled,
485510 state : {
486511 lastRunStatus : runStatus ,
487512 lastDeliveryStatus : "not-delivered" ,
488- ...( expectedStatus === " running" ? { runningAtMs : Date . now ( ) } : { } ) ,
513+ ...( running ? { runningAtMs : Date . now ( ) } : { } ) ,
489514 } ,
490515 } ) ;
491516
517+ const list = createRuntimeLogCapture ( ) ;
518+ printCronList ( [ job ] , list . runtime ) ;
519+ expectLogsToInclude ( list . logs , expectedStatus ) ;
520+
492521 const show = createRuntimeLogCapture ( ) ;
493522 printCronShow ( job , show . runtime ) ;
494523
495524 expectLogsToInclude ( show . logs , `status: ${ expectedStatus } ` ) ;
496525 expect ( show . logs . join ( "\n" ) ) . not . toContain ( "ok (not delivered)" ) ;
497526 expect ( enrichCronJsonWithStatus ( job ) ) . toMatchObject ( { status : expectedStatus } ) ;
527+ expect ( enrichCronJsonWithStatus ( { jobs : [ job ] } ) ) . toMatchObject ( {
528+ jobs : [ { status : expectedStatus } ] ,
529+ } ) ;
498530 } ,
499531 ) ;
500532
0 commit comments