mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
Merge pull request #1363 from BogdanAlexandru/testfix1361
[Test Fix] Mock cloned object in SaveAsActionSpec
This commit is contained in:
commit
b9601ff819
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user