From 6f3d4792d5c837c62c922fc7e1842d2c65a7ea09 Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 12 Jul 2022 10:03:58 +0200 Subject: [PATCH] update backTest --- .../entry/specs/latestBuysFilter.spec.js | 20 +++++++++---------- .../back/methods/item/specs/filter.spec.js | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/entry/back/methods/entry/specs/latestBuysFilter.spec.js b/modules/entry/back/methods/entry/specs/latestBuysFilter.spec.js index 7c813ea89..cb1ed4793 100644 --- a/modules/entry/back/methods/entry/specs/latestBuysFilter.spec.js +++ b/modules/entry/back/methods/entry/specs/latestBuysFilter.spec.js @@ -15,7 +15,7 @@ describe('Entry latests buys filter()', () => { const results = await models.Buy.latestBuysFilter(ctx, options); const firstBuy = results[0]; - expect(results.length).toEqual(1); + expect(results.length).toEqual(3); expect(firstBuy.size).toEqual(70); await tx.rollback(); @@ -38,7 +38,7 @@ describe('Entry latests buys filter()', () => { const results = await models.Buy.latestBuysFilter(ctx, options); - expect(results.length).toEqual(1); + expect(results.length).toEqual(3); await tx.rollback(); } catch (e) { @@ -62,7 +62,7 @@ describe('Entry latests buys filter()', () => { const results = await models.Buy.latestBuysFilter(ctx, options); - expect(results.length).toBe(2); + expect(results.length).toBe(4); await tx.rollback(); } catch (e) { @@ -84,7 +84,7 @@ describe('Entry latests buys filter()', () => { const results = await models.Buy.latestBuysFilter(ctx, options); - expect(results.length).toBe(4); + expect(results.length).toBe(7); await tx.rollback(); } catch (e) { @@ -106,7 +106,7 @@ describe('Entry latests buys filter()', () => { const results = await models.Buy.latestBuysFilter(ctx, options); - expect(results.length).toBe(4); + expect(results.length).toBe(7); await tx.rollback(); } catch (e) { @@ -128,7 +128,7 @@ describe('Entry latests buys filter()', () => { const results = await models.Buy.latestBuysFilter(ctx, options); - expect(results.length).toBe(6); + expect(results.length).toBe(12); await tx.rollback(); } catch (e) { @@ -172,7 +172,7 @@ describe('Entry latests buys filter()', () => { const results = await models.Buy.latestBuysFilter(ctx, options); - expect(results.length).toBe(5); + expect(results.length).toBe(11); await tx.rollback(); } catch (e) { @@ -238,7 +238,7 @@ describe('Entry latests buys filter()', () => { const results = await models.Buy.latestBuysFilter(ctx, options); - expect(results.length).toBe(5); + expect(results.length).toBe(11); await tx.rollback(); } catch (e) { @@ -260,7 +260,7 @@ describe('Entry latests buys filter()', () => { const results = await models.Buy.latestBuysFilter(ctx, options); - expect(results.length).toBe(6); + expect(results.length).toBe(12); await tx.rollback(); } catch (e) { @@ -282,7 +282,7 @@ describe('Entry latests buys filter()', () => { const results = await models.Buy.latestBuysFilter(ctx, options); - expect(results.length).toBe(1); + expect(results.length).toBe(4); await tx.rollback(); } catch (e) { diff --git a/modules/item/back/methods/item/specs/filter.spec.js b/modules/item/back/methods/item/specs/filter.spec.js index 6a173576d..46c3c5dbe 100644 --- a/modules/item/back/methods/item/specs/filter.spec.js +++ b/modules/item/back/methods/item/specs/filter.spec.js @@ -1,7 +1,7 @@ const models = require('vn-loopback/server/server').models; describe('item filter()', () => { - it('should return 1 result filtering by id', async() => { + it('should return 3 result filtering by id', async() => { const tx = await models.Item.beginTransaction({}); const options = {transaction: tx}; @@ -10,7 +10,7 @@ describe('item filter()', () => { const ctx = {args: {filter: filter, search: 1}}; const result = await models.Item.filter(ctx, filter, options); - expect(result.length).toEqual(1); + expect(result.length).toEqual(3); expect(result[0].id).toEqual(1); await tx.rollback(); @@ -20,7 +20,7 @@ describe('item filter()', () => { } }); - it('should return 1 result filtering by barcode', async() => { + it('should return 2 result filtering by barcode', async() => { const tx = await models.Item.beginTransaction({}); const options = {transaction: tx}; @@ -29,7 +29,7 @@ describe('item filter()', () => { const ctx = {args: {filter: filter, search: 4444444444}}; const result = await models.Item.filter(ctx, filter, options); - expect(result.length).toEqual(1); + expect(result.length).toEqual(2); expect(result[0].id).toEqual(2); await tx.rollback();