mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 08:39:59 +00:00
[Add] Update persistence capability spec
...to reflect removal of cached domain object models.
This commit is contained in:
@ -36,6 +36,7 @@ define(
|
|||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
mockIdentifier,
|
mockIdentifier,
|
||||||
mockNofificationService,
|
mockNofificationService,
|
||||||
|
mockCacheService,
|
||||||
mockQ,
|
mockQ,
|
||||||
id = "object id",
|
id = "object id",
|
||||||
model,
|
model,
|
||||||
@ -81,6 +82,10 @@ define(
|
|||||||
"notificationService",
|
"notificationService",
|
||||||
["error"]
|
["error"]
|
||||||
);
|
);
|
||||||
|
mockCacheService = jasmine.createSpyObj(
|
||||||
|
"cacheService",
|
||||||
|
[ "get", "put", "remove", "all" ]
|
||||||
|
);
|
||||||
|
|
||||||
mockDomainObject = {
|
mockDomainObject = {
|
||||||
getId: function () { return id; },
|
getId: function () { return id; },
|
||||||
@ -96,6 +101,7 @@ define(
|
|||||||
mockIdentifierService.parse.andReturn(mockIdentifier);
|
mockIdentifierService.parse.andReturn(mockIdentifier);
|
||||||
mockIdentifier.getSpace.andReturn(SPACE);
|
mockIdentifier.getSpace.andReturn(SPACE);
|
||||||
persistence = new PersistenceCapability(
|
persistence = new PersistenceCapability(
|
||||||
|
mockCacheService,
|
||||||
mockPersistenceService,
|
mockPersistenceService,
|
||||||
mockIdentifierService,
|
mockIdentifierService,
|
||||||
mockNofificationService,
|
mockNofificationService,
|
||||||
@ -170,6 +176,11 @@ define(
|
|||||||
expect(mockQ.reject).not.toHaveBeenCalled();
|
expect(mockQ.reject).not.toHaveBeenCalled();
|
||||||
expect(mockNofificationService.error).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() {
|
describe("unsuccessful persistence", function() {
|
||||||
var sadPromise = {
|
var sadPromise = {
|
||||||
|
Reference in New Issue
Block a user