[Failing Test] Mock cloned object in SaveAs spec

This commit is contained in:
Alex M 2016-12-20 12:41:58 +02:00
parent 532f7a76f9
commit d99b4d35ab

View File

@ -27,6 +27,7 @@ define(
describe("The Save As action", function () { describe("The Save As action", function () {
var mockDomainObject, var mockDomainObject,
mockClonedObject,
mockEditorCapability, mockEditorCapability,
mockActionCapability, mockActionCapability,
mockObjectService, mockObjectService,
@ -58,7 +59,8 @@ define(
[ [
"getCapability", "getCapability",
"hasCapability", "hasCapability",
"getModel" "getModel",
"getId"
] ]
); );
mockDomainObject.hasCapability.andReturn(true); mockDomainObject.hasCapability.andReturn(true);
@ -66,6 +68,15 @@ define(
return capabilities[capability]; return capabilities[capability];
}); });
mockDomainObject.getModel.andReturn({location: 'a', persisted: undefined}); mockDomainObject.getModel.andReturn({location: 'a', persisted: undefined});
mockDomainObject.getId.andReturn(0);
mockClonedObject = jasmine.createSpyObj(
"clonedObject",
[
"getId"
]
);
mockClonedObject.getId.andReturn(1);
mockParent = jasmine.createSpyObj( mockParent = jasmine.createSpyObj(
"parentObject", "parentObject",
@ -112,6 +123,7 @@ define(
"perform" "perform"
] ]
); );
mockCopyService.perform.andReturn(mockPromise(mockClonedObject));
mockNotificationService = jasmine.createSpyObj( mockNotificationService = jasmine.createSpyObj(
"notificationService", "notificationService",