mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Inital platform relayering (#6385)
* moving test files and inital refactoring * relayer extension host code * fix imports * make insights work * relayer dashboard * relayer notebooks * moveing more code around * formatting * accept angular as browser * fix serializer * add missing files * remove declarations from extensions * fix build errors * more relayering * change urls to relative to help code relayering * remove layering to prep for merge * fix hygiene errors * fix hygiene errors * fix tests
This commit is contained in:
@@ -7,7 +7,7 @@ import { OptionsDialog } from 'sql/workbench/browser/modal/optionsDialog';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import * as azdata from 'azdata';
|
||||
import { localize } from 'vs/nls';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
|
||||
export class AdvancedPropertiesController {
|
||||
private _advancedDialog: OptionsDialog;
|
||||
|
||||
@@ -14,7 +14,7 @@ import { IDialogService, IConfirmation, IConfirmationResult } from 'vs/platform/
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
|
||||
import { EditDataInput } from 'sql/workbench/parts/editData/common/editDataInput';
|
||||
import { DashboardInput } from 'sql/workbench/parts/dashboard/dashboardInput';
|
||||
import { DashboardInput } from 'sql/workbench/parts/dashboard/common/dashboardInput';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { OptionsDialog } from 'sql/workbench/browser/modal/optionsDialog';
|
||||
import { AdvancedPropertiesController } from 'sql/workbench/parts/connection/browser/advancedPropertiesController';
|
||||
import * as azdata from 'azdata';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as assert from 'assert';
|
||||
import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
||||
|
||||
suite('Advanced properties dialog tests', () => {
|
||||
let advancedController: AdvancedPropertiesController;
|
||||
let providerOptions: azdata.ConnectionOption[];
|
||||
|
||||
setup(() => {
|
||||
advancedController = new AdvancedPropertiesController(() => { }, null);
|
||||
providerOptions = [
|
||||
{
|
||||
name: 'a1',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: 'a',
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: null,
|
||||
valueType: ServiceOptionType.string
|
||||
},
|
||||
{
|
||||
name: 'b1',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: 'b',
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: null,
|
||||
valueType: ServiceOptionType.string
|
||||
},
|
||||
{
|
||||
name: 'noType',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: null,
|
||||
valueType: ServiceOptionType.string
|
||||
},
|
||||
{
|
||||
name: 'a2',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: 'a',
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: null,
|
||||
valueType: ServiceOptionType.string
|
||||
},
|
||||
{
|
||||
name: 'b2',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: 'b',
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: null,
|
||||
valueType: ServiceOptionType.string
|
||||
}
|
||||
];
|
||||
});
|
||||
|
||||
test('advanced dialog should open when showDialog in advancedController get called', () => {
|
||||
let isAdvancedDialogCalled = false;
|
||||
let options: { [name: string]: any } = {};
|
||||
let advanceDialog = TypeMoq.Mock.ofType(OptionsDialog, TypeMoq.MockBehavior.Strict,
|
||||
'', // title
|
||||
'', // name
|
||||
{}, // options
|
||||
undefined, // partsService
|
||||
undefined, // themeService
|
||||
undefined, // Context view service
|
||||
undefined, // instantiation Service
|
||||
undefined, // telemetry service
|
||||
new MockContextKeyService() // contextkeyservice
|
||||
);
|
||||
advanceDialog.setup(x => x.open(TypeMoq.It.isAny(), TypeMoq.It.isAny())).callback(() => {
|
||||
isAdvancedDialogCalled = true;
|
||||
});
|
||||
advancedController.advancedDialog = advanceDialog.object;
|
||||
advancedController.showDialog(providerOptions, options);
|
||||
assert.equal(isAdvancedDialogCalled, true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user