[Edit] Final two actions now use finish()
This commit is contained in:
@@ -71,7 +71,7 @@ define(
|
||||
EditAction.prototype.perform = function () {
|
||||
var self = this;
|
||||
function cancelEditing() {
|
||||
self.domainObject.getCapability('editor').cancel();
|
||||
self.domainObject.getCapability('editor').finish();
|
||||
self.navigationService.removeListener(cancelEditing);
|
||||
}
|
||||
//If this is not the currently navigated object, then navigate
|
||||
|
||||
@@ -72,7 +72,7 @@ define(
|
||||
}
|
||||
|
||||
function onCancel() {
|
||||
return editorCapability.cancel();
|
||||
return editorCapability.finish();
|
||||
}
|
||||
|
||||
newModel.type = this.type.getKey();
|
||||
|
||||
@@ -58,7 +58,7 @@ define(
|
||||
);
|
||||
mockEditor = jasmine.createSpyObj(
|
||||
"editorCapability",
|
||||
["edit", "isEditContextRoot", "cancel"]
|
||||
["edit", "isEditContextRoot", "finish"]
|
||||
);
|
||||
|
||||
capabilities = {
|
||||
@@ -98,11 +98,11 @@ define(
|
||||
expect(EditAction.appliesTo(actionContext)).toBe(false);
|
||||
});
|
||||
|
||||
it ("cancels editing when user navigates away", function () {
|
||||
it ("finishes editing when user navigates away", function () {
|
||||
action.perform();
|
||||
expect(mockNavigationService.addListener).toHaveBeenCalled();
|
||||
mockNavigationService.addListener.mostRecentCall.args[0]();
|
||||
expect(mockEditor.cancel).toHaveBeenCalled();
|
||||
expect(mockEditor.finish).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it ("invokes the Edit capability on the object", function () {
|
||||
|
||||
@@ -103,7 +103,7 @@ define(
|
||||
[
|
||||
"edit",
|
||||
"save",
|
||||
"cancel"
|
||||
"finish"
|
||||
]
|
||||
);
|
||||
|
||||
@@ -178,10 +178,10 @@ define(
|
||||
expect(capabilities.editor.save).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("to cancel the edit if user cancels dialog", function () {
|
||||
it("to finish the edit if user cancels dialog", function () {
|
||||
action.perform();
|
||||
promise.then.mostRecentCall.args[1]();
|
||||
expect(capabilities.editor.cancel).toHaveBeenCalled();
|
||||
expect(capabilities.editor.finish).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user