mirror of
https://github.com/nasa/openmct.git
synced 2025-02-18 16:40:58 +00:00
[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:
parent
05f4832608
commit
c594ad8918
@ -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");
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user