mirror of
https://github.com/nasa/openmct.git
synced 2025-01-01 19:06:40 +00:00
[Core] Update spec for CompositionCapability
...to reflect changes to separate out contextualization of domain objects
This commit is contained in:
parent
c4aed57165
commit
bc4c7feb6c
@ -25,8 +25,11 @@
|
|||||||
* CompositionCapabilitySpec. Created by vwoeltje on 11/6/14.
|
* CompositionCapabilitySpec. Created by vwoeltje on 11/6/14.
|
||||||
*/
|
*/
|
||||||
define(
|
define(
|
||||||
["../../src/capabilities/CompositionCapability"],
|
[
|
||||||
function (CompositionCapability) {
|
"../../src/capabilities/CompositionCapability",
|
||||||
|
"../../src/capabilities/ContextualDomainObject"
|
||||||
|
],
|
||||||
|
function (CompositionCapability, ContextualDomainObject) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var DOMAIN_OBJECT_METHODS = [
|
var DOMAIN_OBJECT_METHODS = [
|
||||||
@ -40,6 +43,7 @@ define(
|
|||||||
describe("The composition capability", function () {
|
describe("The composition capability", function () {
|
||||||
var mockDomainObject,
|
var mockDomainObject,
|
||||||
mockInjector,
|
mockInjector,
|
||||||
|
mockContextualize,
|
||||||
mockObjectService,
|
mockObjectService,
|
||||||
composition;
|
composition;
|
||||||
|
|
||||||
@ -70,11 +74,19 @@ define(
|
|||||||
return (name === "objectService") && mockObjectService;
|
return (name === "objectService") && mockObjectService;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
mockContextualize = jasmine.createSpy('contextualize');
|
||||||
|
|
||||||
|
// Provide a minimal (e.g. no error-checking) implementation
|
||||||
|
// of contextualize for simplicity
|
||||||
|
mockContextualize.andCallFake(function (domainObject, parentObject) {
|
||||||
|
return new ContextualDomainObject(domainObject, parentObject);
|
||||||
|
});
|
||||||
|
|
||||||
mockObjectService.getObjects.andReturn(mockPromise([]));
|
mockObjectService.getObjects.andReturn(mockPromise([]));
|
||||||
|
|
||||||
composition = new CompositionCapability(
|
composition = new CompositionCapability(
|
||||||
mockInjector,
|
mockInjector,
|
||||||
|
mockContextualize,
|
||||||
mockDomainObject
|
mockDomainObject
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user