From d99b4d35abd95e1d41ef747beb402379697a5cd1 Mon Sep 17 00:00:00 2001 From: Alex M Date: Tue, 20 Dec 2016 12:41:58 +0200 Subject: [PATCH] [Failing Test] Mock cloned object in SaveAs spec --- .../commonUI/edit/test/actions/SaveAsActionSpec.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js index 8cb02679ec..3261ba3d3a 100644 --- a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js @@ -27,6 +27,7 @@ define( describe("The Save As action", function () { var mockDomainObject, + mockClonedObject, mockEditorCapability, mockActionCapability, mockObjectService, @@ -58,7 +59,8 @@ define( [ "getCapability", "hasCapability", - "getModel" + "getModel", + "getId" ] ); mockDomainObject.hasCapability.andReturn(true); @@ -66,6 +68,15 @@ define( return capabilities[capability]; }); mockDomainObject.getModel.andReturn({location: 'a', persisted: undefined}); + mockDomainObject.getId.andReturn(0); + + mockClonedObject = jasmine.createSpyObj( + "clonedObject", + [ + "getId" + ] + ); + mockClonedObject.getId.andReturn(1); mockParent = jasmine.createSpyObj( "parentObject", @@ -112,6 +123,7 @@ define( "perform" ] ); + mockCopyService.perform.andReturn(mockPromise(mockClonedObject)); mockNotificationService = jasmine.createSpyObj( "notificationService",