fix tests

This commit is contained in:
Marc-Roig 2022-11-21 15:00:47 +01:00
parent b0091aa4a8
commit 6a1100b4f9
2 changed files with 5 additions and 5 deletions

View File

@ -589,7 +589,7 @@ const createEntityManager = (db) => {
.connect(relsToAdd)
.get()
// set the order based on the order of the ids
.reduce((acc, rel, idx) => Object.assign(acc, { [rel.id]: idx }), {});
.reduce((acc, rel, idx) => ({ ...acc, [rel.id]: idx }), {});
insert.forEach((row) => {
row[orderColumnName] = orderMap[row[inverseJoinColumn.name]];

View File

@ -817,11 +817,11 @@ describe('Relations', () => {
],
});
// const expectedShop = shopFactory({
// anyToManyRel: [{ id: id2 }, { id: id1 }, { id: id3 }],
// });
const expectedShop = shopFactory({
anyToManyRel: [{ id: id2 }, { id: id1 }, { id: id3 }],
});
expect(updatedShop).toMatchObject({ a: 'test' });
expect(updatedShop).toMatchObject(expectedShop);
});
});
});