[Edit] Final two actions now use finish()
This commit is contained in:
@@ -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