6822-entryTransfer #3376
|
@ -23,6 +23,8 @@ describe('Transfer merchandise from one entry to the next day()', () => {
|
||||||
|
|
||||||
const newEntrybuys = await models.Buy.find({where: {entryFk: result[0].newEntryFk}}, options);
|
const newEntrybuys = await models.Buy.find({where: {entryFk: result[0].newEntryFk}}, options);
|
||||||
|
|
||||||
|
const newTravel = await models.Entry.find({where: {id: result[0].newEntryFk}}, options);
|
||||||
|
|
||||||
const itemShelvingsWithBuys = await models.Buy.find({
|
const itemShelvingsWithBuys = await models.Buy.find({
|
||||||
include: {
|
include: {
|
||||||
relation: 'itemShelving',
|
relation: 'itemShelving',
|
||||||
|
@ -37,6 +39,9 @@ describe('Transfer merchandise from one entry to the next day()', () => {
|
||||||
|
|
||||||
expect(newEntrybuys.length).toEqual(originalEntrybuys.length - hasItemShelving.length);
|
expect(newEntrybuys.length).toEqual(originalEntrybuys.length - hasItemShelving.length);
|
||||||
|
|
||||||
|
await models.Travel.destroyById(newTravel, options);
|
||||||
|
await models.Entry.destroyById(result[0].newEntryFk, options);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
Loading…
Reference in New Issue