[Edit] Rename cancel() to finish()
This commit is contained in:
@@ -63,7 +63,7 @@ define(
|
||||
|
||||
capabilities.editor = jasmine.createSpyObj(
|
||||
"editor",
|
||||
["save", "cancel", "isEditContextRoot"]
|
||||
["save", "finish", "isEditContextRoot"]
|
||||
);
|
||||
capabilities.action = jasmine.createSpyObj(
|
||||
"actionCapability",
|
||||
@@ -105,7 +105,7 @@ define(
|
||||
return !!capabilities[name];
|
||||
});
|
||||
|
||||
capabilities.editor.cancel.andReturn(mockPromise(true));
|
||||
capabilities.editor.finish.andReturn(mockPromise(true));
|
||||
|
||||
action = new CancelAction(actionContext);
|
||||
|
||||
@@ -130,8 +130,8 @@ define(
|
||||
capabilities.action.perform.andReturn(mockPromise(true));
|
||||
action.perform();
|
||||
|
||||
// Should have called cancel
|
||||
expect(capabilities.editor.cancel).toHaveBeenCalled();
|
||||
// Should have called finish
|
||||
expect(capabilities.editor.finish).toHaveBeenCalled();
|
||||
|
||||
// Definitely shouldn't call save!
|
||||
expect(capabilities.editor.save).not.toHaveBeenCalled();
|
||||
|
||||
@@ -57,7 +57,7 @@ define(
|
||||
);
|
||||
mockEditorCapability = jasmine.createSpyObj(
|
||||
"editor",
|
||||
["save", "cancel", "isEditContextRoot"]
|
||||
["save", "finish", "isEditContextRoot"]
|
||||
);
|
||||
mockActionCapability = jasmine.createSpyObj(
|
||||
"actionCapability",
|
||||
@@ -105,13 +105,13 @@ define(
|
||||
}));
|
||||
action.perform();
|
||||
expect(mockEditorCapability.save).toHaveBeenCalled();
|
||||
expect(mockEditorCapability.cancel).not.toHaveBeenCalled();
|
||||
expect(mockEditorCapability.finish).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("closes the editor after saving", function () {
|
||||
action.perform();
|
||||
expect(mockEditorCapability.save).toHaveBeenCalled();
|
||||
expect(mockEditorCapability.cancel).toHaveBeenCalled();
|
||||
expect(mockEditorCapability.finish).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -139,10 +139,10 @@ define(
|
||||
});
|
||||
});
|
||||
|
||||
describe("cancel", function () {
|
||||
describe("finish", function () {
|
||||
beforeEach(function () {
|
||||
capability.edit();
|
||||
capability.cancel();
|
||||
capability.finish();
|
||||
});
|
||||
it("cancels the transaction", function () {
|
||||
expect(mockTransactionService.cancel).toHaveBeenCalled();
|
||||
@@ -158,7 +158,7 @@ define(
|
||||
beforeEach(function () {
|
||||
mockDomainObject.getModel.andReturn(model);
|
||||
capability.edit();
|
||||
capability.cancel();
|
||||
capability.finish();
|
||||
});
|
||||
it("returns true if the object has been modified since it" +
|
||||
" was last persisted", function () {
|
||||
|
||||
Reference in New Issue
Block a user