@@ -434,27 +434,59 @@ describe("printCronList", () => {
434434 ) ;
435435
436436 it . each ( [
437- { label : "disabled" , enabled : false , runStatus : "ok" as const , expectedStatus : "disabled" } ,
438- { label : "running" , enabled : true , runStatus : "ok" as const , expectedStatus : "running" } ,
439- { label : "failed" , enabled : true , runStatus : "error" as const , expectedStatus : "error" } ,
437+ {
438+ label : "disabled" ,
439+ enabled : false ,
440+ running : false ,
441+ runStatus : "ok" as const ,
442+ expectedStatus : "disabled" ,
443+ } ,
444+ {
445+ label : "running" ,
446+ enabled : true ,
447+ running : true ,
448+ runStatus : "ok" as const ,
449+ expectedStatus : "running" ,
450+ } ,
451+ {
452+ label : "paused but force-running" ,
453+ enabled : false ,
454+ running : true ,
455+ runStatus : "ok" as const ,
456+ expectedStatus : "running" ,
457+ } ,
458+ {
459+ label : "failed" ,
460+ enabled : true ,
461+ running : false ,
462+ runStatus : "error" as const ,
463+ expectedStatus : "error" ,
464+ } ,
440465 ] ) (
441466 "does not let prior non-delivery override a $label automation" ,
442- ( { enabled, runStatus, expectedStatus } ) => {
467+ ( { enabled, running , runStatus, expectedStatus } ) => {
443468 const job = createBaseJob ( {
444469 enabled,
445470 state : {
446471 lastRunStatus : runStatus ,
447472 lastDeliveryStatus : "not-delivered" ,
448- ...( expectedStatus === " running" ? { runningAtMs : Date . now ( ) } : { } ) ,
473+ ...( running ? { runningAtMs : Date . now ( ) } : { } ) ,
449474 } ,
450475 } ) ;
451476
477+ const list = createRuntimeLogCapture ( ) ;
478+ printCronList ( [ job ] , list . runtime ) ;
479+ expectLogsToInclude ( list . logs , expectedStatus ) ;
480+
452481 const show = createRuntimeLogCapture ( ) ;
453482 printCronShow ( job , show . runtime ) ;
454483
455484 expectLogsToInclude ( show . logs , `status: ${ expectedStatus } ` ) ;
456485 expect ( show . logs . join ( "\n" ) ) . not . toContain ( "ok (not delivered)" ) ;
457486 expect ( enrichCronJsonWithStatus ( job ) ) . toMatchObject ( { status : expectedStatus } ) ;
487+ expect ( enrichCronJsonWithStatus ( { jobs : [ job ] } ) ) . toMatchObject ( {
488+ jobs : [ { status : expectedStatus } ] ,
489+ } ) ;
458490 } ,
459491 ) ;
460492
0 commit comments