mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 01:25:38 -05:00
Remove typings and replace missing methods with vscodes (#8217)
* remove typings and replace missing methods with vscodes * fix strict-null-checks * fix tests
This commit is contained in:
@@ -402,8 +402,8 @@ suite('Advanced options helper tests', () => {
|
||||
let optionsList = [categoryOption, booleanOption, numberOption, stringOption, defaultGroupOption];
|
||||
let optionsMap = OptionsDialogHelper.groupOptionsByCategory(optionsList);
|
||||
let categoryNames = Object.keys(optionsMap);
|
||||
assert.equal(categoryNames.includes('Initialization'), true);
|
||||
assert.equal(categoryNames.includes('General'), true);
|
||||
assert.equal(categoryNames.some(x => x === 'Initialization'), true);
|
||||
assert.equal(categoryNames.some(x => x === 'General'), true);
|
||||
assert.equal(categoryNames.length, 2);
|
||||
assert.equal(optionsMap['Initialization'].length, 4);
|
||||
assert.equal(optionsMap['General'].length, 1);
|
||||
|
||||
@@ -14,6 +14,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
|
||||
import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
|
||||
import { TestEditorService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
|
||||
suite('TaskUtilities', function () {
|
||||
test('getCurrentGlobalConnection returns the selected OE server if a server or one of its children is selected', () => {
|
||||
@@ -63,7 +64,7 @@ suite('TaskUtilities', function () {
|
||||
let mockConnectionManagementService = TypeMoq.Mock.ofType(TestConnectionManagementService);
|
||||
let mockWorkbenchEditorService = TypeMoq.Mock.ofType(TestEditorService);
|
||||
let oeProfile = new ConnectionProfile(undefined, connectionProfile);
|
||||
let connectionProfile2 = Object.assign({}, connectionProfile);
|
||||
let connectionProfile2 = assign({}, connectionProfile);
|
||||
connectionProfile2.serverName = 'test_server_2';
|
||||
connectionProfile2.id = 'test_id_2';
|
||||
let tabProfile = new ConnectionProfile(undefined, connectionProfile2);
|
||||
|
||||
@@ -11,6 +11,7 @@ import { MainThreadModelViewShape } from 'sql/workbench/api/common/sqlExtHost.pr
|
||||
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { IComponentShape, IItemConfig, ComponentEventType, IComponentEventArgs, ModelComponentTypes } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { TitledFormItemLayout } from 'sql/workbench/browser/modelComponents/formContainer.component';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
|
||||
interface InternalItemConfig {
|
||||
toIItemConfig(): IItemConfig;
|
||||
@@ -188,7 +189,7 @@ suite('ExtHostModelView Validation Tests', () => {
|
||||
topLevelInputFormComponent,
|
||||
{
|
||||
components: [
|
||||
Object.assign(groupInputFormComponent, { layout: groupInputLayout }),
|
||||
assign(groupInputFormComponent, { layout: groupInputLayout }),
|
||||
groupDropdownFormComponent
|
||||
],
|
||||
title: groupTitle
|
||||
|
||||
@@ -9,6 +9,7 @@ import * as TypeMoq from 'typemoq';
|
||||
|
||||
import { MainThreadObjectExplorerShape } from 'sql/workbench/api/common/sqlExtHost.protocol';
|
||||
import { ExtHostObjectExplorerNode } from 'sql/workbench/api/common/extHostObjectExplorer';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
|
||||
const nodes: { [nodeName: string]: azdata.NodeInfo } =
|
||||
{
|
||||
@@ -74,7 +75,7 @@ suite('ExtHostObjectExplorer Tests', () => {
|
||||
mockProxy.setup(p =>
|
||||
p.$getNode(TypeMoq.It.isAny(), TypeMoq.It.isAny()))
|
||||
.returns((connectionId, nodePath) => {
|
||||
return Promise.resolve<azdata.NodeInfo>(nodes[Object.keys(nodes).find(key =>
|
||||
return Promise.resolve<azdata.NodeInfo>(nodes[find(Object.keys(nodes), key =>
|
||||
nodes[key].nodePath === nodePath)]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user