提交 51b35920 编写于 作者: S Sandeep Somavarapu

#21375 Fix test

上级 33fd6f4e
......@@ -355,13 +355,23 @@ suite('ExtensionsWorkbenchService Test', () => {
assert.ok(!testObject.canInstall(target));
});
test('test canInstall returns true for extensions with gallery', () => {
test('test canInstall returns false for a system extension', () => {
const local = aLocalExtension('a', { version: '1.0.1' }, { type: LocalExtensionType.System });
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]);
instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension(local.manifest.name, { id: local.id })));
testObject = instantiationService.createInstance(ExtensionsWorkbenchService);
const target = testObject.local[0];
assert.ok(!testObject.canInstall(target));
});
test('test canInstall returns true for extensions with gallery', () => {
const local = aLocalExtension('a', { version: '1.0.1' }, { type: LocalExtensionType.User });
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]);
instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension(local.manifest.name, { id: local.id })));
testObject = instantiationService.createInstance(ExtensionsWorkbenchService);
const target = testObject.local[0];
return eventToPromise(testObject.onChange).then(() => {
assert.ok(testObject.canInstall(target));
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册