From e2c6a4575610e89c29cc32e9e6718af45189befb Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 6 Sep 2024 12:57:57 +0200 Subject: [PATCH] fix: refs #7931 Available back test fix --- .../item/back/methods/item/specs/getVisibleAvailable.spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/item/back/methods/item/specs/getVisibleAvailable.spec.js b/modules/item/back/methods/item/specs/getVisibleAvailable.spec.js index f068a3a32..adf9b7f76 100644 --- a/modules/item/back/methods/item/specs/getVisibleAvailable.spec.js +++ b/modules/item/back/methods/item/specs/getVisibleAvailable.spec.js @@ -1,7 +1,7 @@ const models = require('vn-loopback/server/server').models; 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 options = {transaction: tx}; @@ -9,10 +9,11 @@ describe('item getVisibleAvailable()', () => { const itemFk = 1; const warehouseFk = 1; const dated = Date.vnNew(); + dated.setDate(dated.getDate() + 1); 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); await tx.rollback();