refactor: refs #6824 Fix tests
This commit is contained in:
parent
ba9d0743b5
commit
7fc2e34af9
|
@ -34,6 +34,11 @@ module.exports = Self => {
|
||||||
try {
|
try {
|
||||||
const promises = [];
|
const promises = [];
|
||||||
for (let itemShelvingId of itemShelvingIds) {
|
for (let itemShelvingId of itemShelvingIds) {
|
||||||
|
const itemShelvingSaleToDelete = models.ItemShelvingSale.destroyAll({
|
||||||
|
itemShelvingFk: itemShelvingId
|
||||||
|
}, myOptions);
|
||||||
|
promises.push(itemShelvingSaleToDelete);
|
||||||
|
|
||||||
const itemShelvingToDelete = models.ItemShelving.destroyById(itemShelvingId, myOptions);
|
const itemShelvingToDelete = models.ItemShelving.destroyById(itemShelvingId, myOptions);
|
||||||
promises.push(itemShelvingToDelete);
|
promises.push(itemShelvingToDelete);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe('ItemShelving deleteItemShelvings()', () => {
|
||||||
const itemShelvingIds = [1, 2];
|
const itemShelvingIds = [1, 2];
|
||||||
const result = await models.ItemShelving.deleteItemShelvings(itemShelvingIds, options);
|
const result = await models.ItemShelving.deleteItemShelvings(itemShelvingIds, options);
|
||||||
|
|
||||||
expect(result.length).toEqual(2);
|
expect(result.length).toEqual(4);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue