fix Object explorer tests (#4135)

This commit is contained in:
Aditya Bist
2019-02-25 09:51:43 -08:00
committed by GitHub
parent c3f02980a0
commit f2c9d968a4
3 changed files with 23 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ if (context.RunTest) {
let nodes = <sqlops.objectexplorer.ObjectExplorerNode[]>await sqlops.objectexplorer.getActiveConnectionNodes();
assert(nodes.length === 1, `expecting 1 active connection, actual: ${nodes.length}`);
let actions = await sqlops.objectexplorer.getNodeActions(nodes[0].connectionId, nodes[0].nodePath);
const expectedActions = ['Manage', 'New Query', 'Disconnect', 'Delete Connection', 'Refresh', 'Launch Profiler'];
const expectedActions = ['Manage', 'New Query', 'Disconnect', 'Delete Connection', 'Refresh', 'New Notebook', 'Launch Profiler'];
const expectedString = expectedActions.join(',');
const actualString = actions.join(',');

View File

@@ -34,5 +34,5 @@ export async function connectToServer(server: TestServerProfile) {
}
export async function ensureConnectionViewOpened() {
await vscode.commands.executeCommand('workbench.view.connections');
await vscode.commands.executeCommand('workbench.view.dataExplorer');
}

View File

@@ -14,8 +14,25 @@ import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } fr
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { OpenConnectionsViewletAction } from 'sql/parts/objectExplorer/common/registeredServer.contribution';
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { ToggleViewletAction } from 'vs/workbench/browser/parts/activitybar/activitybarActions';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IPartService } from 'vs/workbench/services/part/common/partService';
// Viewlet Action
export class OpenDataExplorerViewletAction extends ToggleViewletAction {
public static ID = VIEWLET_ID;
public static LABEL = 'Show Data Explorer';
constructor(
id: string,
label: string,
@IViewletService viewletService: IViewletService,
@IPartService partService: IPartService
) {
super(viewletDescriptor, partService, viewletService);
}
}
// Data Explorer Viewlet
const viewletDescriptor = new ViewletDescriptor(
@@ -34,9 +51,9 @@ if (process.env.NODE_ENV === 'development') {
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
registry.registerWorkbenchAction(
new SyncActionDescriptor(
OpenConnectionsViewletAction,
OpenConnectionsViewletAction.ID,
OpenConnectionsViewletAction.LABEL,
OpenDataExplorerViewletAction,
OpenDataExplorerViewletAction.ID,
OpenDataExplorerViewletAction.LABEL,
{ primary: KeyMod.CtrlCmd | KeyCode.Shift | KeyCode.KEY_C }),
'View: Show Servers',
localize('registeredServers.view', "View")