mirror of
https://github.com/nasa/openmct.git
synced 2025-04-16 15:29:20 +00:00
[Add] Update spec for Instantiate
...to reflect usage of a model cache for #770
This commit is contained in:
parent
d12111d9b8
commit
9f29382e18
@ -32,8 +32,7 @@ define(
|
||||
mockIdentifierService,
|
||||
mockCapabilityConstructor,
|
||||
mockCapabilityInstance,
|
||||
mockCapabilities,
|
||||
mockIdentifier,
|
||||
mockCacheService,
|
||||
idCounter,
|
||||
testModel,
|
||||
instantiate,
|
||||
@ -62,11 +61,17 @@ define(
|
||||
"some-id-" + (idCounter += 1);
|
||||
});
|
||||
|
||||
mockCacheService = jasmine.createSpyObj(
|
||||
'cacheService',
|
||||
[ 'get', 'put', 'remove', 'all' ]
|
||||
);
|
||||
|
||||
testModel = { someKey: "some value" };
|
||||
|
||||
instantiate = new Instantiate(
|
||||
mockCapabilityService,
|
||||
mockIdentifierService
|
||||
mockIdentifierService,
|
||||
mockCacheService
|
||||
);
|
||||
domainObject = instantiate(testModel);
|
||||
});
|
||||
@ -92,6 +97,13 @@ define(
|
||||
expect(instantiate(testModel).getId())
|
||||
.not.toEqual(domainObject.getId());
|
||||
});
|
||||
|
||||
it("caches the instantiated model", function () {
|
||||
expect(mockCacheService.put).toHaveBeenCalledWith(
|
||||
domainObject.getId(),
|
||||
testModel
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user