mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
fix Object explorer tests (#4135)
This commit is contained in:
@@ -19,7 +19,7 @@ if (context.RunTest) {
|
|||||||
let nodes = <sqlops.objectexplorer.ObjectExplorerNode[]>await sqlops.objectexplorer.getActiveConnectionNodes();
|
let nodes = <sqlops.objectexplorer.ObjectExplorerNode[]>await sqlops.objectexplorer.getActiveConnectionNodes();
|
||||||
assert(nodes.length === 1, `expecting 1 active connection, actual: ${nodes.length}`);
|
assert(nodes.length === 1, `expecting 1 active connection, actual: ${nodes.length}`);
|
||||||
let actions = await sqlops.objectexplorer.getNodeActions(nodes[0].connectionId, nodes[0].nodePath);
|
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 expectedString = expectedActions.join(',');
|
||||||
const actualString = actions.join(',');
|
const actualString = actions.join(',');
|
||||||
|
|||||||
@@ -34,5 +34,5 @@ export async function connectToServer(server: TestServerProfile) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function ensureConnectionViewOpened() {
|
export async function ensureConnectionViewOpened() {
|
||||||
await vscode.commands.executeCommand('workbench.view.connections');
|
await vscode.commands.executeCommand('workbench.view.dataExplorer');
|
||||||
}
|
}
|
||||||
@@ -14,8 +14,25 @@ import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } fr
|
|||||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||||
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
|
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
|
||||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
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 { 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
|
// Data Explorer Viewlet
|
||||||
const viewletDescriptor = new ViewletDescriptor(
|
const viewletDescriptor = new ViewletDescriptor(
|
||||||
@@ -34,9 +51,9 @@ if (process.env.NODE_ENV === 'development') {
|
|||||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||||
registry.registerWorkbenchAction(
|
registry.registerWorkbenchAction(
|
||||||
new SyncActionDescriptor(
|
new SyncActionDescriptor(
|
||||||
OpenConnectionsViewletAction,
|
OpenDataExplorerViewletAction,
|
||||||
OpenConnectionsViewletAction.ID,
|
OpenDataExplorerViewletAction.ID,
|
||||||
OpenConnectionsViewletAction.LABEL,
|
OpenDataExplorerViewletAction.LABEL,
|
||||||
{ primary: KeyMod.CtrlCmd | KeyCode.Shift | KeyCode.KEY_C }),
|
{ primary: KeyMod.CtrlCmd | KeyCode.Shift | KeyCode.KEY_C }),
|
||||||
'View: Show Servers',
|
'View: Show Servers',
|
||||||
localize('registeredServers.view', "View")
|
localize('registeredServers.view', "View")
|
||||||
|
|||||||
Reference in New Issue
Block a user