rework panel to not need platform (#5270)

This commit is contained in:
Anthony Dresser
2019-04-30 13:19:21 -07:00
committed by GitHub
parent f70369c2a6
commit 48682bacde
14 changed files with 107 additions and 97 deletions

View File

@@ -10,6 +10,7 @@ import { Dialog, DialogTab } from 'sql/platform/dialog/dialogTypes';
import { DialogPane } from 'sql/platform/dialog/dialogPane';
import { DialogComponentParams } from 'sql/platform/dialog/dialogContainer.component';
import { bootstrapAngular } from 'sql/platform/bootstrap/node/bootstrapService';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
interface BootstrapAngular {
@@ -41,7 +42,8 @@ suite('Dialog Pane Tests', () => {
bootstrapCalls++;
});
dialog.content = modelViewId;
let dialogPane = new DialogPane(dialog.title, dialog.content, () => undefined, undefined, false);
const themeService = new TestThemeService();
let dialogPane = new DialogPane(dialog.title, dialog.content, () => undefined, undefined, themeService, false);
dialogPane.createBody(container);
assert.equal(bootstrapCalls, 1);
});
@@ -55,7 +57,8 @@ suite('Dialog Pane Tests', () => {
bootstrapCalls++;
});
dialog.content = [new DialogTab('', modelViewId)];
let dialogPane = new DialogPane(dialog.title, dialog.content, () => undefined, undefined, false);
const themeService = new TestThemeService();
let dialogPane = new DialogPane(dialog.title, dialog.content, () => undefined, undefined, themeService, false);
dialogPane.createBody(container);
assert.equal(bootstrapCalls, 1);
});
@@ -71,7 +74,8 @@ suite('Dialog Pane Tests', () => {
let modelViewId1 = 'test_content_1';
let modelViewId2 = 'test_content_2';
dialog.content = [new DialogTab('tab1', modelViewId1), new DialogTab('tab2', modelViewId2)];
let dialogPane = new DialogPane(dialog.title, dialog.content, valid => dialog.notifyValidityChanged(valid), undefined, false);
const themeService = new TestThemeService();
let dialogPane = new DialogPane(dialog.title, dialog.content, valid => dialog.notifyValidityChanged(valid), undefined, themeService, false);
dialogPane.createBody(container);
let validityChanges: boolean[] = [];