update backTest
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2022-07-12 10:03:58 +02:00
parent eaa7658b23
commit 6f3d4792d5
2 changed files with 14 additions and 14 deletions

View File

@ -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) {

View File

@ -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();