@@ -639,7 +639,9 @@ describe('SysMetadataRepository — a declared ordered map: object `fields` (#21
639639 expect ( published . version ) . toBe ( hashSpec ( body ( MOVED ) , 'object' ) ) ;
640640 expect ( storedOrder ( engine ) ) . toEqual ( MOVED ) ;
641641 expect ( Object . keys ( ( await repo . get ( ref ) ) ! . body . fields as object ) ) . toEqual ( MOVED ) ;
642- expect ( engine . historyRows ( ) . map ( ( r ) => r . operation_type ) ) . toEqual ( [ 'create' , 'publish' ] ) ;
642+ // The active create, the draft's own row, and the publish — the write the
643+ // order-blind hash used to skip.
644+ expect ( engine . historyRows ( ) . map ( ( r ) => r . operation_type ) ) . toEqual ( [ 'create' , 'create' , 'publish' ] ) ;
643645 } ) ;
644646
645647 it ( '…while an identical re-save is still the no-op it was' , async ( ) => {
@@ -705,8 +707,8 @@ describe('SysMetadataRepository — a declared ordered map: object `fields` (#21
705707 await repo . promoteDraft ( ref , { actor : 't' , intent } ) ;
706708
707709 expect ( storedOrder ( engine ) ) . toEqual ( MOVED ) ;
708- const [ publish ] = engine . historyRows ( ) ;
709- expect ( publish ) . toMatchObject ( { operation_type : 'publish' , previous_checksum : stamp } ) ;
710+ const publish = engine . historyRows ( ) . find ( ( r ) => r . operation_type === 'publish' ) ;
711+ expect ( publish ) . toMatchObject ( { previous_checksum : stamp } ) ;
710712 } ) ;
711713
712714 it ( 'a reorder INTO sorted order is written, though its hash IS the stale stamp' , async ( ) => {
@@ -719,7 +721,8 @@ describe('SysMetadataRepository — a declared ordered map: object `fields` (#21
719721 await repo . promoteDraft ( ref , { actor : 't' , intent } ) ;
720722
721723 expect ( storedOrder ( engine ) ) . toEqual ( SORTED ) ;
722- expect ( engine . historyRows ( ) . map ( ( r ) => r . operation_type ) ) . toEqual ( [ 'publish' ] ) ;
724+ // The draft's own row, then the publish the stale stamp would have skipped.
725+ expect ( engine . historyRows ( ) . map ( ( r ) => r . operation_type ) ) . toEqual ( [ 'create' , 'publish' ] ) ;
723726 } ) ;
724727 } ) ;
725728} ) ;
0 commit comments