mirror of
https://github.com/nasa/openmct.git
synced 2024-12-23 23:12:23 +00:00
[Duplicate] Add test case
Add test case for single-element string arrays, to replicate bug around type coercion. https://github.com/nasa/openmctweb/issues/444
This commit is contained in:
parent
82e4a53472
commit
995d71f901
@ -106,7 +106,8 @@ define(
|
||||
composition: [ ID_A, ID_B ],
|
||||
someObj: {},
|
||||
someArr: [ ID_A, ID_B ],
|
||||
objArr: [{"id": ID_A}, {"id": ID_B}]
|
||||
objArr: [{"id": ID_A}, {"id": ID_B}],
|
||||
singleElementArr: [ ID_A ]
|
||||
};
|
||||
testModel.someObj[ID_A] = "some value";
|
||||
testModel.someObj.someProperty = ID_B;
|
||||
@ -181,6 +182,13 @@ define(
|
||||
expect(model.someObj[cloneIds[ID_A]])
|
||||
.toEqual(testModel.someObj[ID_A]);
|
||||
});
|
||||
|
||||
it("contain rewritten identifiers in single-element arrays", function () {
|
||||
expect(model.singleElementArr)
|
||||
.toEqual(testModel.singleElementArr.map(function (id) {
|
||||
return cloneIds[id];
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
describe("copies object trees with multiple references to the" +
|
||||
|
Loading…
Reference in New Issue
Block a user