Fixed issue where migrating attributes lost their base value calculation

This commit is contained in:
Stefan Zermatten
2022-02-09 12:37:16 +02:00
parent 78c313e3d1
commit 2bdd60b5e8
4 changed files with 72 additions and 5 deletions

View File

@@ -44,6 +44,15 @@ describe('transformFields', function () {
assert.equal(doc.name, 'DOC NAME', 'name in uppercase');
});
it('Creates objects on the fly', function () {
let doc = {...originalDoc};
const transformList = [
{from: 'name', to:'newObj.name'},
];
doc = transformFields(doc, transformList);
assert.deepEqual(doc.newObj, {name: 'doc name'});
});
it('Handles empty to and from fields', function () {
let doc = {...originalDoc};
const transformList = [