[Core] Update spec for CompositionCapability

...to reflect changes to separate out contextualization
of domain objects
This commit is contained in:
Victor Woeltjen 2015-09-17 13:57:20 -07:00
parent c4aed57165
commit bc4c7feb6c

View File

@ -25,8 +25,11 @@
* CompositionCapabilitySpec. Created by vwoeltje on 11/6/14.
*/
define(
["../../src/capabilities/CompositionCapability"],
function (CompositionCapability) {
[
"../../src/capabilities/CompositionCapability",
"../../src/capabilities/ContextualDomainObject"
],
function (CompositionCapability, ContextualDomainObject) {
"use strict";
var DOMAIN_OBJECT_METHODS = [
@ -40,6 +43,7 @@ define(
describe("The composition capability", function () {
var mockDomainObject,
mockInjector,
mockContextualize,
mockObjectService,
composition;
@ -70,11 +74,19 @@ define(
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([]));
composition = new CompositionCapability(
mockInjector,
mockContextualize,
mockDomainObject
);
});
@ -113,4 +125,4 @@ define(
});
}
);
);