[Framework] Add spec for property retention

Add spec to verify that static properties exposed by
extension constructors remain visible after these
have been converted to partial constructors. These
static methods have various uses, such as providing
appliesTo methods to classes where pre-instantiation
filtering is useful. WTD-572.
This commit is contained in:
Victor Woeltjen 2014-11-20 10:48:04 -08:00
parent 05f4832608
commit c594ad8918

View File

@ -26,6 +26,8 @@ define(
this.message = [x, y, z].join(" ");
}
RegularConstructor.someProperty = "test property";
beforeEach(function () {
result = undefined;
PartializedConstructor = new PartialConstructor(RegularConstructor);
@ -62,6 +64,14 @@ define(
expect(instance instanceof ThisStyleConstructor).toBeTruthy();
});
it("retains static properties after partialization", function () {
// This string should appear after invoking the partialized
// constructor, such that the resulting inner constructor
// exposes these as if we were looking at the original
// RegularConstructor.
expect(new PartializedConstructor().someProperty).toEqual("test property");
});
});
}
);