mirror of
https://github.com/nasa/openmct.git
synced 2025-04-21 09:31:24 +00:00
[Add] Update persistence capability spec
...to reflect removal of cached domain object models.
This commit is contained in:
parent
1e4ff5a73f
commit
baccd005dc
@ -36,6 +36,7 @@ define(
|
||||
mockDomainObject,
|
||||
mockIdentifier,
|
||||
mockNofificationService,
|
||||
mockCacheService,
|
||||
mockQ,
|
||||
id = "object id",
|
||||
model,
|
||||
@ -81,6 +82,10 @@ define(
|
||||
"notificationService",
|
||||
["error"]
|
||||
);
|
||||
mockCacheService = jasmine.createSpyObj(
|
||||
"cacheService",
|
||||
[ "get", "put", "remove", "all" ]
|
||||
);
|
||||
|
||||
mockDomainObject = {
|
||||
getId: function () { return id; },
|
||||
@ -96,6 +101,7 @@ define(
|
||||
mockIdentifierService.parse.andReturn(mockIdentifier);
|
||||
mockIdentifier.getSpace.andReturn(SPACE);
|
||||
persistence = new PersistenceCapability(
|
||||
mockCacheService,
|
||||
mockPersistenceService,
|
||||
mockIdentifierService,
|
||||
mockNofificationService,
|
||||
@ -170,6 +176,11 @@ define(
|
||||
expect(mockQ.reject).not.toHaveBeenCalled();
|
||||
expect(mockNofificationService.error).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("removes the model from the cache", function () {
|
||||
persistence.persist();
|
||||
expect(mockCacheService.remove).toHaveBeenCalledWith(id);
|
||||
});
|
||||
});
|
||||
describe("unsuccessful persistence", function() {
|
||||
var sadPromise = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user