mirror of
https://github.com/nasa/openmct.git
synced 2025-01-02 03:16:41 +00:00
[Dialog] Test options dialog
Test dialog which provides the user with buttons showing different options, WTD-1033.
This commit is contained in:
parent
8c35f9eb81
commit
548d91d362
@ -37,7 +37,7 @@ define(
|
|||||||
// OK button click
|
// OK button click
|
||||||
function confirm(value) {
|
function confirm(value) {
|
||||||
// Pass along the result
|
// Pass along the result
|
||||||
deferred.resolve(resultGetter(value));
|
deferred.resolve(resultGetter ? resultGetter() : value);
|
||||||
|
|
||||||
// Stop showing the dialog
|
// Stop showing the dialog
|
||||||
dismiss();
|
dismiss();
|
||||||
@ -94,6 +94,7 @@ define(
|
|||||||
return overlayModel.value;
|
return overlayModel.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show the overlay-dialog
|
||||||
return getDialogResponse(
|
return getDialogResponse(
|
||||||
"overlay-dialog",
|
"overlay-dialog",
|
||||||
overlayModel,
|
overlayModel,
|
||||||
@ -102,15 +103,10 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getUserChoice(dialogModel) {
|
function getUserChoice(dialogModel) {
|
||||||
// We just want to pass back the result from the template
|
// Show the overlay-options dialog
|
||||||
function echo(value) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return getDialogResponse(
|
return getDialogResponse(
|
||||||
"overlay-options",
|
"overlay-options",
|
||||||
{ dialog: dialogModel },
|
{ dialog: dialogModel }
|
||||||
echo
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,6 +86,19 @@ define(
|
|||||||
expect(mockDeferred.reject).not.toHaveBeenCalled();
|
expect(mockDeferred.reject).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("provides an options dialogs", function () {
|
||||||
|
var dialogModel = {};
|
||||||
|
dialogService.getUserChoice(dialogModel);
|
||||||
|
expect(mockOverlayService.createOverlay).toHaveBeenCalledWith(
|
||||||
|
'overlay-options',
|
||||||
|
{
|
||||||
|
dialog: dialogModel,
|
||||||
|
confirm: jasmine.any(Function),
|
||||||
|
cancel: jasmine.any(Function)
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
Loading…
Reference in New Issue
Block a user