mirror of
https://github.com/nasa/openmct.git
synced 2025-06-12 20:28:14 +00:00
[Persistence] Don't expect persist calls in spec
This commit is contained in:
@ -29,7 +29,6 @@ define(
|
|||||||
mockOtherObject,
|
mockOtherObject,
|
||||||
mockActionCapability,
|
mockActionCapability,
|
||||||
mockEditorCapability,
|
mockEditorCapability,
|
||||||
mockPersistence,
|
|
||||||
mockContext,
|
mockContext,
|
||||||
mockAction,
|
mockAction,
|
||||||
handler;
|
handler;
|
||||||
@ -76,7 +75,6 @@ define(
|
|||||||
[ "getId", "getCapability", "useCapability", "hasCapability" ]
|
[ "getId", "getCapability", "useCapability", "hasCapability" ]
|
||||||
);
|
);
|
||||||
mockActionCapability = jasmine.createSpyObj("action", ["perform", "getActions"]);
|
mockActionCapability = jasmine.createSpyObj("action", ["perform", "getActions"]);
|
||||||
mockPersistence = jasmine.createSpyObj("persistence", ["persist"]);
|
|
||||||
mockContext = jasmine.createSpyObj('context', [ 'getParent' ]);
|
mockContext = jasmine.createSpyObj('context', [ 'getParent' ]);
|
||||||
|
|
||||||
mockActionCapability.getActions.andReturn([mockAction]);
|
mockActionCapability.getActions.andReturn([mockAction]);
|
||||||
@ -89,14 +87,12 @@ define(
|
|||||||
mockSwimlane.domainObject.getCapability.andCallFake(function (c) {
|
mockSwimlane.domainObject.getCapability.andCallFake(function (c) {
|
||||||
return {
|
return {
|
||||||
action: mockActionCapability,
|
action: mockActionCapability,
|
||||||
persistence: mockPersistence,
|
|
||||||
editor: mockEditorCapability
|
editor: mockEditorCapability
|
||||||
}[c];
|
}[c];
|
||||||
});
|
});
|
||||||
mockSwimlane.parent.domainObject.getCapability.andCallFake(function (c) {
|
mockSwimlane.parent.domainObject.getCapability.andCallFake(function (c) {
|
||||||
return {
|
return {
|
||||||
action: mockActionCapability,
|
action: mockActionCapability,
|
||||||
persistence: mockPersistence,
|
|
||||||
editor: mockEditorCapability
|
editor: mockEditorCapability
|
||||||
}[c];
|
}[c];
|
||||||
});
|
});
|
||||||
@ -162,8 +158,6 @@ define(
|
|||||||
mockSwimlane.domainObject.useCapability.mostRecentCall
|
mockSwimlane.domainObject.useCapability.mostRecentCall
|
||||||
.args[1](testModel);
|
.args[1](testModel);
|
||||||
expect(testModel.composition).toEqual(['c', 'd']);
|
expect(testModel.composition).toEqual(['c', 'd']);
|
||||||
// Finally, should also have persisted
|
|
||||||
expect(mockPersistence.persist).toHaveBeenCalled();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("inserts after as a peer when highlighted at the bottom", function () {
|
it("inserts after as a peer when highlighted at the bottom", function () {
|
||||||
|
Reference in New Issue
Block a user