This commit is contained in:
parent
382e54b572
commit
e2c6a45756
|
@ -1,7 +1,7 @@
|
||||||
const models = require('vn-loopback/server/server').models;
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
describe('item getVisibleAvailable()', () => {
|
describe('item getVisibleAvailable()', () => {
|
||||||
it('should check available visible for today', async() => {
|
it('should check available visible for tomorrow', async() => {
|
||||||
const tx = await models.Item.beginTransaction({});
|
const tx = await models.Item.beginTransaction({});
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
|
@ -9,10 +9,11 @@ describe('item getVisibleAvailable()', () => {
|
||||||
const itemFk = 1;
|
const itemFk = 1;
|
||||||
const warehouseFk = 1;
|
const warehouseFk = 1;
|
||||||
const dated = Date.vnNew();
|
const dated = Date.vnNew();
|
||||||
|
dated.setDate(dated.getDate() + 1);
|
||||||
|
|
||||||
const result = await models.Item.getVisibleAvailable(itemFk, warehouseFk, dated, options);
|
const result = await models.Item.getVisibleAvailable(itemFk, warehouseFk, dated, options);
|
||||||
|
|
||||||
expect(result.available).toEqual(175);
|
expect(result.available).toEqual(185);
|
||||||
expect(result.visible).toEqual(92);
|
expect(result.visible).toEqual(92);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
Loading…
Reference in New Issue