[New Edit Mode] Added AddAction, modified EditableDomainObject to properly wrap inherited functions, added new EditableInstantiationCapability

This commit is contained in:
Henry
2016-01-20 18:49:39 -08:00
parent fcae3fd7a9
commit c65096f166
13 changed files with 512 additions and 71 deletions

View File

@ -118,6 +118,29 @@ define(
expect(mockContext.getDomainObject.calls.length).toEqual(2);
});
it("wraps inherited methods", function () {
var CapabilityClass = function(){
};
CapabilityClass.prototype.inheritedMethod=function () {
return "an inherited method";
};
mockContext = new CapabilityClass();
capability = new EditableLookupCapability(
mockContext,
mockEditableObject,
mockDomainObject,
factory,
false
);
expect(capability.inheritedMethod()).toEqual("an inherited method");
expect(capability.hasOwnProperty('inheritedMethod')).toBe(true);
// The presence of an own property indicates that the method
// has been wrapped on the object itself and this is a valid
// test that the inherited method has been wrapped.
});
});
}
);