mirror of
https://github.com/nasa/openmct.git
synced 2025-02-07 11:30:28 +00:00
[Failing Test] Mock cloned object in SaveAs spec
This commit is contained in:
parent
532f7a76f9
commit
d99b4d35ab
@ -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",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user