2023-07-18 06:54:45 +00:00
|
|
|
const models = require('vn-loopback/server/server').models;
|
|
|
|
|
|
|
|
describe('itemShelving getInventory()', () => {
|
|
|
|
it('should return a list of itemShelvings', async() => {
|
|
|
|
const tx = await models.ItemShelving.beginTransaction({});
|
|
|
|
|
|
|
|
let response;
|
|
|
|
try {
|
|
|
|
const options = {transaction: tx};
|
2023-07-18 12:11:50 +00:00
|
|
|
await models.ItemShelving.rawSql(`
|
|
|
|
UPDATE vn.config
|
|
|
|
SET mainWarehouseFk=1
|
|
|
|
WHERE id=1
|
|
|
|
`, null, options);
|
|
|
|
response = await models.ItemShelving.getInventory('100-01', 'LR-02-3', options);
|
2023-07-18 06:54:45 +00:00
|
|
|
await tx.rollback();
|
|
|
|
} catch (e) {
|
|
|
|
await tx.rollback();
|
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
|
|
|
|
expect(response.length).toEqual(2);
|
|
|
|
});
|
|
|
|
});
|