#6276 createNewWarehouse methods migrated from silex to salix #1850
|
@ -0,0 +1,22 @@
|
||||||
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
|
describe('itemShelving updateFromSale()', () => {
|
||||||
|
it('should update the quantity', async() => {
|
||||||
|
const tx = await models.ItemBarcode.beginTransaction({});
|
||||||
|
const options = {transaction: tx};
|
||||||
|
const saleFk = 2;
|
||||||
|
const filter = {where: {itemFk: 4, shelvingFk: 'HEJ'}
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
const {visible: visibleBefore} = await models.ItemShelving.findOne(filter, options);
|
||||||
|
await models.ItemShelving.updateFromSale(saleFk, options);
|
||||||
|
const {visible: visibleAfter} = await models.ItemShelving.findOne(filter, options);
|
||||||
|
|
||||||
|
expect(visibleAfter).toEqual(visibleBefore + 5);
|
||||||
|
await tx.rollback();
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,6 +1,6 @@
|
||||||
const {models} = require('vn-loopback/server/server');
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
fdescribe('item card()', () => {
|
describe('item card()', () => {
|
||||||
const itemFk = 1;
|
const itemFk = 1;
|
||||||
const warehouseFk = 1;
|
const warehouseFk = 1;
|
||||||
it('WIP: should get something', async() => {
|
it('WIP: should get something', async() => {
|
||||||
|
|
Loading…
Reference in New Issue