mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 05:37:53 +00:00
[bug] TypeImpl.getInitialmodel should always return a fresh (ie. cloned) model. #316
This commit is contained in:
parent
2b2ac0b0d9
commit
606667eb4d
@ -157,7 +157,7 @@ define(
|
||||
};
|
||||
|
||||
TypeImpl.prototype.getInitialModel = function () {
|
||||
return this.typeDef.model || {};
|
||||
return JSON.parse(JSON.stringify(this.typeDef.model || {}));
|
||||
};
|
||||
|
||||
TypeImpl.prototype.getDefinition = function () {
|
||||
|
@ -101,6 +101,10 @@ define(
|
||||
expect(type.getInitialModel().someKey).toEqual("some value");
|
||||
});
|
||||
|
||||
it("provides a fresh initial model each time", function () {
|
||||
expect(type.getInitialModel().someKey).toEqual("some value");
|
||||
});
|
||||
|
||||
it("provides type properties", function () {
|
||||
expect(type.getProperties().length).toEqual(1);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user