@@ -356,6 +356,22 @@ describe('Customize a read-only base’s dashboard into its pair (objectstack#28
356356 expect ( srv . saves [ 1 ] ! . opts . packageId ) . toBe ( PAIR ) ;
357357 } ) ;
358358
359+ it ( 'the first save into the pair is pinned to "no draft there", the next to the version it was answered' , async ( ) => {
360+ mount ( ) ;
361+ await openPipeline ( ) ;
362+ await customize ( ) ;
363+
364+ patchBoard ( ) ;
365+ await waitFor ( ( ) => expect ( srv . saves ) . toHaveLength ( 1 ) , { timeout : 8000 } ) ;
366+ expect ( srv . saves [ 0 ] ! . opts ) . toMatchObject ( { packageId : PAIR , ifNoneMatch : '*' } ) ;
367+ expect ( srv . saves [ 0 ] ! . opts ) . not . toHaveProperty ( 'ifMatch' ) ;
368+
369+ patchBoard ( ) ;
370+ await waitFor ( ( ) => expect ( srv . saves ) . toHaveLength ( 2 ) , { timeout : 8000 } ) ;
371+ expect ( srv . saves [ 1 ] ! . opts ) . toMatchObject ( { packageId : PAIR , ifMatch : 'v1' } ) ;
372+ expect ( srv . saves [ 1 ] ! . opts ) . not . toHaveProperty ( 'ifNoneMatch' ) ;
373+ } ) ;
374+
359375 it ( 'a second item asks the door again and is answered 200; it is written into the same pair' , async ( ) => {
360376 mount ( ) ;
361377 await openPipeline ( ) ;
@@ -513,6 +529,8 @@ describe('Customize an object leaf’s list view into the pair (objectstack#2856
513529 expect ( saved ) . toMatchObject ( { type : 'view' , name : 'opportunity.default' , opts : { mode : 'draft' , packageId : PAIR } } ) ;
514530 expect ( ( saved ! . body . config as Record < string , unknown > ) . calendar ) . toEqual ( { startDateField : 'start_date' , titleField : 'name' } ) ;
515531 expect ( saved ! . body . overrides ) . toEqual ( { package : BASE , basedOn : '4.0.0' } ) ;
532+ // Read at the base before the pair was there: pinned to "no draft in the pair".
533+ expect ( saved ! . opts ) . toMatchObject ( { ifNoneMatch : '*' } ) ;
516534 expect ( srv . base . get ( 'view/opportunity.default' ) ) . toStrictEqual ( BASE_ROWS [ 'view/opportunity.default' ] ) ;
517535 await within ( header ( ) ) . findByTestId ( 'studio-override-chip' , undefined , { timeout : 8000 } ) ;
518536 expect ( screen . getByRole ( 'button' , { name : t ( 'engine.studio.inspector.listView.addView' , 'en' ) } ) ) . toBeDisabled ( ) ;
0 commit comments