@@ -130,13 +130,36 @@ describe("isAutoSettlementCandidate", () => {
130130 snoozedAt : at ( - 60 * 60 * 1_000 ) ,
131131 } ) ;
132132 expect ( isAutoSettlementCandidate ( snoozed , NOW_MS ) ) . toBe ( false ) ;
133- expect ( isAutoSettlementCandidate ( shell ( { ...snoozed , status : "failed" } ) , NOW_MS ) ) . toBe ( true ) ;
133+ expect (
134+ isAutoSettlementCandidate (
135+ shell ( { ...snoozed , status : "failed" , latestRunCompletedAt : at ( - 30 * 60 * 1_000 ) } ) ,
136+ NOW_MS ,
137+ ) ,
138+ ) . toBe ( true ) ;
134139 expect (
135140 isAutoSettlementCandidate (
136141 shell ( { ...snoozed , latestRunCompletedAt : at ( - 30 * 60 * 1_000 ) } ) ,
137142 NOW_MS ,
138143 ) ,
139144 ) . toBe ( true ) ;
145+ expect (
146+ isAutoSettlementCandidate (
147+ shell ( { ...snoozed , status : "failed" , latestRunCompletedAt : at ( - 2 * 60 * 60 * 1_000 ) } ) ,
148+ NOW_MS ,
149+ ) ,
150+ ) . toBe ( false ) ;
151+ expect (
152+ isAutoSettlementCandidate (
153+ shell ( { ...snoozed , status : "failed" , latestRunCompletedAt : snoozed . snoozedAt } ) ,
154+ NOW_MS ,
155+ ) ,
156+ ) . toBe ( false ) ;
157+ expect (
158+ isAutoSettlementCandidate (
159+ shell ( { ...snoozed , status : "failed" , latestRunCompletedAt : null } ) ,
160+ NOW_MS ,
161+ ) ,
162+ ) . toBe ( false ) ;
140163 // Expired snooze is no longer a park.
141164 expect ( isAutoSettlementCandidate ( shell ( { ...snoozed , snoozedUntil : at ( - 1 ) } ) , NOW_MS ) ) . toBe (
142165 true ,
0 commit comments