@@ -780,9 +780,10 @@ describe('automaticMatchmaking: with Atomic Deployments enabled', () => {
780780
781781 test ( 'creates the missing extension when there is a remote one' , async ( ) => {
782782 // When
783+ const registrationA = { ...REGISTRATION_A , id : '' }
783784 const got = await automaticMatchmaking (
784785 [ EXTENSION_A , EXTENSION_A_2 ] ,
785- [ REGISTRATION_A ] ,
786+ [ registrationA ] ,
786787 { 'extension-a' : 'UUID_A' } ,
787788 testDeveloperPlatformClient ( { supportsAtomicDeployments : true } ) ,
788789 )
@@ -805,16 +806,21 @@ describe('outputAddedIDs', () => {
805806 vi . mocked ( outputInfo ) . mockClear ( )
806807
807808 // Extension B has a valid UID
808- REGISTRATION_B . id = EXTENSION_B . uid
809+ // Extension C is marked as toCreate because we only try to match by UID (because it has a real one)
810+ const registrationA = { ...REGISTRATION_A , id : '' }
811+ const registrationB = { ...REGISTRATION_B , id : EXTENSION_B . uid }
812+ const registrationC = { ...REGISTRATION_C }
813+ const registrationD = { ...REGISTRATION_D , id : '' }
809814
810815 // When: Extensions are matched by UUID (not by UID)
811- await automaticMatchmaking (
812- [ EXTENSION_A , EXTENSION_B , EXTENSION_C ] ,
813- [ REGISTRATION_A , REGISTRATION_B , REGISTRATION_C ] ,
816+ const result = await automaticMatchmaking (
817+ [ EXTENSION_A , EXTENSION_B , EXTENSION_C , EXTENSION_D ] ,
818+ [ registrationA , registrationB , registrationC , registrationD ] ,
814819 {
815820 'extension-a' : 'UUID_A' ,
816821 'extension-b' : 'UUID_B' ,
817822 'extension-c' : 'UUID_C' ,
823+ 'extension-d' : 'UUID_D' ,
818824 } ,
819825 testDeveloperPlatformClient ( { supportsAtomicDeployments : true } ) ,
820826 )
@@ -823,10 +829,13 @@ describe('outputAddedIDs', () => {
823829 expect ( outputInfo ) . toHaveBeenCalledWith ( 'Generating extension IDs\n' )
824830 expect ( outputInfo ) . toHaveBeenCalledWith ( expect . stringContaining ( '\x1B[36mextension-a\x1B[39m | Added ID: UUID_A' ) )
825831 expect ( outputInfo ) . not . toHaveBeenCalledWith ( expect . stringContaining ( 'Added ID: UUID_B' ) )
826- expect ( outputInfo ) . toHaveBeenCalledWith ( expect . stringContaining ( '\x1B[35mextension-c\x1B[39m | Added ID: UUID_C' ) )
832+ expect ( outputInfo ) . not . toHaveBeenCalledWith ( expect . stringContaining ( 'Added ID: UUID_C' ) )
833+ expect ( outputInfo ) . toHaveBeenCalledWith ( expect . stringContaining ( '\x1B[35mextension-d\x1B[39m | Added ID: UUID_D' ) )
827834 expect ( outputInfo ) . toHaveBeenCalledWith ( '\n' )
828835
829836 // Verify it was called 4 times total (header + 2 extensions + footer)
830837 expect ( outputInfo ) . toHaveBeenCalledTimes ( 4 )
838+
839+ expect ( result . toCreate ) . toEqual ( [ EXTENSION_C ] )
831840 } )
832841} )
0 commit comments