Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/models/localizedModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ class LocalizedModel{
if(!model._strMap[`${resolvedArrKey}.${attrKey}`]){
model._strMap[`${resolvedArrKey}.${attrKey}`] = {};
}
if(newVal[attrKey]){
model._setLocalizedValue(`${resolvedArrKey}.${attrKey}`, newVal[attrKey]);
}
});
return true;
}
Expand Down
5 changes: 1 addition & 4 deletions tests/objarray.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ test('Removing object', () => {
expect(serverPayload?.objArray?.length).toBe(0);
});

/*
test('Adding array object with new attributes', () => {
let appObj = new AppObject().fromJSON(serverJSON);
appObj.items.push({
Expand All @@ -117,10 +116,8 @@ test('Adding array object with new attributes', () => {
});

let serverPayload = appObj.toJSON();
console.log('wtf', JSON.stringify(serverPayload, null, 2));
expect(serverPayload?.objArray?.[1]).toBeTruthy();
expect(serverPayload?.objArray?.[1]?.localizations?.en?.header).toBe('new english header');
expect(serverPayload?.objArray?.[1]?.localizations?.en?.description).toBe('new english description');
expect(serverPayload?.objArray?.[1]?.localizations?.en?.subHeader).toBe('new english title');
})
*/
})
Loading