Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)

* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998

* fix pipelines

* fix strict-null-checks

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-21 22:12:22 -07:00
committed by GitHub
parent 7c9be74970
commit 1e22f47304
913 changed files with 18898 additions and 16536 deletions

View File

@@ -305,7 +305,6 @@ suite.skip('ExtensionsTipsService Test', () => { // {{SQL CARBON EDIT}} skip sui
function testNoPromptOrRecommendationsForValidRecommendations(recommendations: string[]) {
return setUpFolderWorkspace('myFolder', mockTestData.validRecommendedExtensions).then(() => {
testObject = instantiationService.createInstance(ExtensionTipsService);
assert.equal(!testObject.loadWorkspaceConfigPromise, true);
assert.ok(!prompted);
return testObject.getWorkspaceRecommendations().then(() => {

View File

@@ -942,6 +942,46 @@ suite('ExtensionsWorkbenchServiceTest', () => {
});
});
test('test installing an extension re-eanbles it when disabled globally', async () => {
testObject = await aWorkbenchService();
const local = aLocalExtension('pub.a');
await instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally);
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Install });
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]);
const actual = await testObject.queryLocal();
assert.equal(actual[0].enablementState, EnablementState.EnabledGlobally);
});
test('test updating an extension does not re-eanbles it when disabled globally', async () => {
testObject = await aWorkbenchService();
const local = aLocalExtension('pub.a');
await instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally);
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Update });
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]);
const actual = await testObject.queryLocal();
assert.equal(actual[0].enablementState, EnablementState.DisabledGlobally);
});
test('test installing an extension re-eanbles it when workspace disabled', async () => {
testObject = await aWorkbenchService();
const local = aLocalExtension('pub.a');
await instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledWorkspace);
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Install });
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]);
const actual = await testObject.queryLocal();
assert.equal(actual[0].enablementState, EnablementState.EnabledGlobally);
});
test('test updating an extension does not re-eanbles it when workspace disabled', async () => {
testObject = await aWorkbenchService();
const local = aLocalExtension('pub.a');
await instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledWorkspace);
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Update });
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]);
const actual = await testObject.queryLocal();
assert.equal(actual[0].enablementState, EnablementState.DisabledWorkspace);
});
async function aWorkbenchService(): Promise<ExtensionsWorkbenchService> {
const workbenchService: ExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService);
await workbenchService.queryLocal();