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