salix/modules/item/back/methods/item-shelving/specs/getListItemNewer.spec.js

33 lines
955 B
JavaScript
Raw Normal View History

2024-06-07 14:29:51 +00:00
const {models} = require('vn-loopback/server/server');
describe('itemShelving getListItemNewer()', () => {
2024-07-05 06:43:45 +00:00
fit('should return true because there is an older item', async() => {
const shelving = 'NBB';
const parking = '700-01';
2024-06-18 08:08:40 +00:00
2024-07-05 06:43:45 +00:00
const sectorCamHighCode = 'FIRST';
const sectorCamCode = 'NS';
2024-06-07 14:29:51 +00:00
const tx = await models.Sector.beginTransaction({});
const myOptions = {transaction: tx};
try {
2024-06-18 08:08:40 +00:00
const config = await models.ProductionConfig.findOne();
await config.updateAttributes({
sectorToCode: sectorCamHighCode,
sectorFromCode: sectorCamCode
});
2024-06-07 14:29:51 +00:00
const result = await models.ItemShelving.getListItemNewer(shelving, parking, myOptions);
2024-07-05 06:43:45 +00:00
expect(result.length).toEqual(3);
2024-06-07 14:29:51 +00:00
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});