@@ -133,6 +133,25 @@ describe("dedupeChecks", () => {
133133 ] ) ;
134134 } ) ;
135135
136+ it ( "puts failed and cancelled checks first, preserving each group's order after reruns" , ( ) => {
137+ const checks = dedupeChecks ( [
138+ entry ( "lint" , "failure" , { at : "2026-08-11T16:00:00Z" } ) ,
139+ entry ( "integration" , "cancelled" ) ,
140+ entry ( "types" , "pending" ) ,
141+ entry ( "unit" , "failure" ) ,
142+ entry ( "format" , "success" ) ,
143+ entry ( "lint" , "success" , { at : "2026-08-11T18:00:00Z" } ) ,
144+ ] ) ;
145+
146+ expect ( checks . map ( ( check ) => [ check . name , check . status ] ) ) . toEqual ( [
147+ [ "integration" , "cancelled" ] ,
148+ [ "unit" , "failure" ] ,
149+ [ "lint" , "success" ] ,
150+ [ "types" , "pending" ] ,
151+ [ "format" , "success" ] ,
152+ ] ) ;
153+ } ) ;
154+
136155 it ( "keeps distinct workflow and check pairs even when their names join to the same text" , ( ) => {
137156 const checks = dedupeChecks ( [
138157 entry ( "Linux tests" , "success" , {
@@ -181,8 +200,8 @@ describe("dedupeChecks", () => {
181200 ] ) ;
182201
183202 expect ( checks . map ( ( check ) => [ check . name , check . status ] ) ) . toEqual ( [
184- [ "CI / build" , "success" ] ,
185203 [ "Release / build" , "failure" ] ,
204+ [ "CI / build" , "success" ] ,
186205 ] ) ;
187206 } ) ;
188207
@@ -193,6 +212,6 @@ describe("dedupeChecks", () => {
193212 entry ( "build" , "failure" , { workflowName : "CI" , at : "2026-08-11T16:00:00Z" } ) ,
194213 ] ) ;
195214
196- expect ( checks . map ( ( check ) => check . name ) ) . toEqual ( [ "build" , "CI / build" ] ) ;
215+ expect ( checks . map ( ( check ) => check . name ) ) . toEqual ( [ "CI / build" , "build" ] ) ;
197216 } ) ;
198217} ) ;
0 commit comments