From c594ad8918555b703d41c475e7f78ed47355f837 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 20 Nov 2014 10:48:04 -0800 Subject: [PATCH] [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. --- .../framework/test/register/PartialConstructorSpec.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/framework/test/register/PartialConstructorSpec.js b/platform/framework/test/register/PartialConstructorSpec.js index b54c1e395d..69f5e8a971 100644 --- a/platform/framework/test/register/PartialConstructorSpec.js +++ b/platform/framework/test/register/PartialConstructorSpec.js @@ -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"); + }); + }); } ); \ No newline at end of file