@@ -1028,6 +1028,32 @@ describe('[#28904] the ceremony moves a row of a member the package does not shi
10281028 expect ( rowsOf ( stores , DIGEST ) . map ( ( r ) => [ r . packageId , r . member , r . state ] ) ) . toEqual ( [ [ PAIR , 'zh-CN' , 'active' ] ] ) ;
10291029 } ) ;
10301030
1031+ it ( '[#29392] an unshipped locale in a row bound to the package itself (a save naming it, before that write was closed): listed bound, and moved into the pair as its own member' , async ( ) => {
1032+ const stores = new Map < string , Map < string , Record < string , unknown > > > ( ) ;
1033+ const first = await boot ( stores ) ;
1034+ await ( first . raw as any ) . getOverlayRepo ( ) . put (
1035+ { type : T , name : DIGEST , org : 'env' } ,
1036+ { ...template ( 'zh-CN' , `ADMIN ${ DIGEST } zh-CN` ) , name : DIGEST , ...ENVELOPE } ,
1037+ { parentVersion : null , actor : null , source : 'older-release' , intent : 'override-artifact' , packageId : PKG } ,
1038+ ) ;
1039+ const { raw } = await boot ( stores ) ;
1040+ expect ( rowsOf ( stores , DIGEST ) . map ( ( r ) => [ r . packageId , r . member ] ) ) . toEqual ( [ [ PKG , 'zh-CN' ] ] ) ;
1041+
1042+ const listed = await census ( raw ) ;
1043+ expect ( listed . rows . map ( ( r : any ) => [ r . name , r . member , r . disposition , r . addedMember , r . base , r . boundToBase ] ) )
1044+ . toEqual ( [ [ DIGEST , 'zh-CN' , 'movable' , 'zh-CN' , PKG , true ] ] ) ;
1045+ const result = await migrate ( raw ) ;
1046+ expect ( result . outcomes ) . toEqual ( [ { id : listed . rows [ 0 ] . id , outcome : 'moved' , packageId : PAIR , addedMember : 'zh-CN' } ] ) ;
1047+ const stored = rowsOf ( stores , DIGEST ) ;
1048+ expect ( stored . map ( ( r ) => [ r . packageId , r . member , r . state ] ) ) . toEqual ( [ [ PAIR , 'zh-CN' , 'active' ] ] ) ;
1049+ expect ( stored [ 0 ] ! . body ) . not . toHaveProperty ( 'overrides' ) ;
1050+ for ( const served of [ raw , ( await boot ( stores ) ) . raw ] ) {
1051+ expect ( await sentMember ( served , DIGEST , 'zh-CN' ) ) . toMatchObject ( { subject : `ADMIN ${ DIGEST } zh-CN` , ...ENVELOPE } ) ;
1052+ expect ( ( await sentMember ( served , DIGEST , 'en-US' ) ) ?. subject ) . toBe ( 'PKG digest en' ) ;
1053+ }
1054+ expect ( ( await migrate ( raw ) ) . rows ) . toEqual ( [ ] ) ;
1055+ } ) ;
1056+
10311057 it ( 'an unshipped locale whose stored body declares the base: the declaration is dropped, as the pair\'s own member carries none' , async ( ) => {
10321058 const { stores, raw } = await withUnboundZh ( DIGEST , { overrides : { package : PKG , basedOn : '0.9.0' } } ) ;
10331059 const result = await migrate ( raw ) ;
0 commit comments