add custom width support for dialogs (#10641)

* add custom width support for dialogs

* comments

* fix test
This commit is contained in:
Alan Ren
2020-06-03 13:08:48 -07:00
committed by GitHub
parent 2e4aee944c
commit c4be667567
12 changed files with 123 additions and 33 deletions

View File

@@ -73,7 +73,7 @@ suite('MainThreadModelViewDialog Tests', () => {
mockDialogService.setup(x => x.showDialog(It.isAny(), undefined, It.isAny())).callback((dialog) => {
openedDialog = dialog;
});
mockDialogService.setup(x => x.showWizard(It.isAny())).callback(wizard => {
mockDialogService.setup(x => x.showWizard(It.isAny(), It.isAny())).callback(wizard => {
openedWizard = wizard;
// The actual service will set the page to 0 when it opens the wizard
openedWizard.setCurrentPage(0);
@@ -111,7 +111,7 @@ suite('MainThreadModelViewDialog Tests', () => {
};
dialogDetails = {
title: 'dialog1',
isWide: false,
width: 'narrow',
content: [tab1Handle, tab2Handle],
okButton: okButtonHandle,
cancelButton: cancelButtonHandle,
@@ -160,7 +160,8 @@ suite('MainThreadModelViewDialog Tests', () => {
customButtons: [],
pages: [page1Handle, page2Handle],
message: undefined,
displayPageTitles: false
displayPageTitles: false,
width: 'wide'
};
// Register the buttons, tabs, and dialog
@@ -242,7 +243,7 @@ suite('MainThreadModelViewDialog Tests', () => {
mainThreadModelViewDialog.$openWizard(wizardHandle);
// Then the opened wizard's content and buttons match what was set
mockDialogService.verify(x => x.showWizard(It.isAny()), Times.once());
mockDialogService.verify(x => x.showWizard(It.isAny(), It.isAny()), Times.once());
assert.notEqual(openedWizard, undefined);
assert.equal(openedWizard.title, wizardDetails.title);
assert.equal(openedWizard.doneButton.label, okButtonDetails.label);