@@ -90,6 +90,21 @@ const MODULE_CLI_A_NO_UID: AppModuleVersion = {
9090 } ,
9191}
9292
93+ const MODULE_CLI_A_EXTERNAL_IDENTIFIER : AppModuleVersion = {
94+ registrationId : 'A' ,
95+ registrationUuid : 'UUID_A' ,
96+ registrationTitle : 'Checkout post purchase' ,
97+ type : 'checkout_post_purchase_external' ,
98+ specification : {
99+ identifier : 'checkout_post_purchase_external' ,
100+ name : 'Post purchase UI extension' ,
101+ experience : 'extension' ,
102+ options : {
103+ managementExperience : 'cli' ,
104+ } ,
105+ } ,
106+ }
107+
93108const MODULE_DASHBOARD_MIGRATED_CLI_A : AppModuleVersion = {
94109 registrationId : 'A' ,
95110 registrationUuid : 'UUID_A' ,
@@ -567,6 +582,49 @@ describe('extensionsIdentifiersDeployBreakdown', () => {
567582 remoteExtensionsRegistrations : remoteExtensionRegistrations . app ,
568583 } )
569584 } )
585+
586+ test ( 'and there is an active version with a module matching a local spec external identifier then cli extension should be unchanged' , async ( ) => {
587+ // Given
588+ const extensionsToConfirm = {
589+ validMatches : { EXTENSION_A : 'UUID_A' } ,
590+ dashboardOnlyExtensions : [ ] ,
591+ extensionsToCreate : [ ] ,
592+ didMigrateDashboardExtensions : false ,
593+ }
594+ vi . mocked ( ensureExtensionsIds ) . mockResolvedValue ( extensionsToConfirm )
595+ const remoteExtensionRegistrations = {
596+ app : {
597+ extensionRegistrations : [ REGISTRATION_A ] ,
598+ configurationRegistrations : [ ] ,
599+ dashboardManagedExtensionRegistrations : [ ] ,
600+ } ,
601+ }
602+ const activeAppVersion = {
603+ appModuleVersions : [ MODULE_CLI_A_EXTERNAL_IDENTIFIER ] ,
604+ }
605+
606+ const developerPlatformClient : DeveloperPlatformClient = testDeveloperPlatformClient ( {
607+ appExtensionRegistrations : ( _app : MinimalAppIdentifiers ) => Promise . resolve ( remoteExtensionRegistrations ) ,
608+ } )
609+
610+ // When
611+ const result = await extensionsIdentifiersDeployBreakdown (
612+ await options ( { uiExtensions : [ EXTENSION_A ] , developerPlatformClient, activeAppVersion} ) ,
613+ )
614+
615+ // Then
616+ expect ( result ) . toEqual ( {
617+ extensionIdentifiersBreakdown : {
618+ onlyRemote : [ ] ,
619+ toCreate : [ ] ,
620+ toUpdate : [ ] ,
621+ unchanged : [ buildExtensionBreakdownInfo ( 'EXTENSION_A' , undefined ) ] ,
622+ } ,
623+ extensionsToConfirm,
624+ remoteExtensionsRegistrations : remoteExtensionRegistrations . app ,
625+ } )
626+ } )
627+
570628 test ( 'and there is an active version with matching dashboard migrated cli app modules then migrated extension should be returned in the to create' , async ( ) => {
571629 // Given
572630 const remoteExtensionRegistrations = {
0 commit comments