@@ -1650,6 +1650,31 @@ suite('ExtensionsWorkbenchServiceTest', () => {
1650
1650
assert . strictEqual ( testObject . isAutoUpdateEnabledFor ( testObject . local [ 2 ] ) , false ) ;
1651
1651
} ) ;
1652
1652
1653
+ test ( 'Test disable auto update for publisher disables for the associated organisation' , async ( ) => {
1654
+ stubConfiguration ( 'onlySelectedExtensions' ) ;
1655
+ stubProductConfiguration ( { publishersByOrganisation : { 'org1' : [ 'pub' , 'pub1' ] } } ) ;
1656
+
1657
+ const extension1 = aLocalExtension ( 'a' , undefined , { pinned : true } ) ;
1658
+ const extension2 = aLocalExtension ( 'b' , { publisher : 'pub1' } , { pinned : true } ) ;
1659
+ const extension3 = aLocalExtension ( 'a' , { publisher : 'pub2' } , { pinned : true } ) ;
1660
+ instantiationService . stubPromise ( IExtensionManagementService , 'getInstalled' , [ extension1 , extension2 , extension3 ] ) ;
1661
+ instantiationService . stub ( IExtensionManagementService , 'updateMetadata' , ( local : ILocalExtension , metadata : Partial < Metadata > ) => {
1662
+ local . pinned = ! ! metadata . pinned ;
1663
+ return local ;
1664
+ } ) ;
1665
+ testObject = await aWorkbenchService ( ) ;
1666
+
1667
+ await testObject . updateAutoUpdateEnablementFor ( testObject . local [ 0 ] . publisher , true ) ;
1668
+ await testObject . updateAutoUpdateEnablementFor ( testObject . local [ 1 ] . publisher , false ) ;
1669
+
1670
+ assert . strictEqual ( testObject . isAutoUpdateEnabledFor ( 'pub' ) , false ) ;
1671
+ assert . strictEqual ( testObject . isAutoUpdateEnabledFor ( 'pub1' ) , false ) ;
1672
+ assert . strictEqual ( testObject . isAutoUpdateEnabledFor ( 'pub2' ) , false ) ;
1673
+ assert . strictEqual ( testObject . isAutoUpdateEnabledFor ( testObject . local [ 0 ] ) , false ) ;
1674
+ assert . strictEqual ( testObject . isAutoUpdateEnabledFor ( testObject . local [ 1 ] ) , false ) ;
1675
+ assert . strictEqual ( testObject . isAutoUpdateEnabledFor ( testObject . local [ 2 ] ) , false ) ;
1676
+ } ) ;
1677
+
1653
1678
async function aWorkbenchService ( ) : Promise < ExtensionsWorkbenchService > {
1654
1679
const workbenchService : ExtensionsWorkbenchService = disposableStore . add ( instantiationService . createInstance ( ExtensionsWorkbenchService ) ) ;
1655
1680
await workbenchService . queryLocal ( ) ;
0 commit comments