fix tests

This commit is contained in:
Deep Tailor 2018-01-04 11:13:53 -08:00 committed by Victor Woeltjen
parent 39d3e92094
commit 557cd91b21
2 changed files with 10 additions and 10 deletions

View File

@ -28,15 +28,15 @@ define(
[],
function () {
function isDirty(domainObject) {
var navigatedObject = domainObject,
editorCapability = navigatedObject &&
navigatedObject.getCapability("editor");
// function isDirty(domainObject) {
// var navigatedObject = domainObject,
// editorCapability = navigatedObject &&
// navigatedObject.getCapability("editor");
return editorCapability &&
editorCapability.isEditContextRoot() &&
editorCapability.dirty();
}
// return editorCapability &&
// editorCapability.isEditContextRoot() &&
// editorCapability.dirty();
// }
function cancelEditing(domainObject) {
var navigatedObject = domainObject,

View File

@ -104,10 +104,10 @@ define(
mockEditorCapability.isEditContextRoot.andReturn(false);
mockEditorCapability.dirty.andReturn(false);
expect(checkFn()).toBe(false);
expect(checkFn()).toBe("Continuing will cause the loss of any unsaved changes.");
mockEditorCapability.isEditContextRoot.andReturn(true);
expect(checkFn()).toBe(false);
expect(checkFn()).toBe("Continuing will cause the loss of any unsaved changes.");
mockEditorCapability.dirty.andReturn(true);
expect(checkFn())