mirror of
https://github.com/nasa/openmct.git
synced 2025-04-09 04:14:32 +00:00
[Persistence] Update spec
Update spec for persistence capability to reflect changes for nasa/openmctweb#92
This commit is contained in:
parent
620c0415cf
commit
e4d136d345
@ -48,7 +48,7 @@ define(
|
||||
beforeEach(function () {
|
||||
mockPersistenceService = jasmine.createSpyObj(
|
||||
"persistenceService",
|
||||
[ "updateObject", "readObject" ]
|
||||
[ "updateObject", "readObject", "createObject", "deleteObject" ]
|
||||
);
|
||||
mockDomainObject = {
|
||||
getId: function () { return id; },
|
||||
@ -68,10 +68,24 @@ define(
|
||||
);
|
||||
});
|
||||
|
||||
it("makes a call to the persistence service when invoked", function () {
|
||||
it("creates unpersisted objects with the persistence service", function () {
|
||||
// Verify precondition; no call made during constructor
|
||||
expect(mockPersistenceService.createObject).not.toHaveBeenCalled();
|
||||
|
||||
persistence.persist();
|
||||
|
||||
expect(mockPersistenceService.createObject).toHaveBeenCalledWith(
|
||||
SPACE,
|
||||
id,
|
||||
model
|
||||
);
|
||||
});
|
||||
|
||||
it("updates previously persisted objects with the persistence service", function () {
|
||||
// Verify precondition; no call made during constructor
|
||||
expect(mockPersistenceService.updateObject).not.toHaveBeenCalled();
|
||||
|
||||
model.persisted = 12321;
|
||||
persistence.persist();
|
||||
|
||||
expect(mockPersistenceService.updateObject).toHaveBeenCalledWith(
|
||||
@ -112,4 +126,4 @@ define(
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user