update backTest
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
eaa7658b23
commit
6f3d4792d5
|
@ -15,7 +15,7 @@ describe('Entry latests buys filter()', () => {
|
||||||
const results = await models.Buy.latestBuysFilter(ctx, options);
|
const results = await models.Buy.latestBuysFilter(ctx, options);
|
||||||
const firstBuy = results[0];
|
const firstBuy = results[0];
|
||||||
|
|
||||||
expect(results.length).toEqual(1);
|
expect(results.length).toEqual(3);
|
||||||
expect(firstBuy.size).toEqual(70);
|
expect(firstBuy.size).toEqual(70);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
@ -38,7 +38,7 @@ describe('Entry latests buys filter()', () => {
|
||||||
|
|
||||||
const results = await models.Buy.latestBuysFilter(ctx, options);
|
const results = await models.Buy.latestBuysFilter(ctx, options);
|
||||||
|
|
||||||
expect(results.length).toEqual(1);
|
expect(results.length).toEqual(3);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -62,7 +62,7 @@ describe('Entry latests buys filter()', () => {
|
||||||
|
|
||||||
const results = await models.Buy.latestBuysFilter(ctx, options);
|
const results = await models.Buy.latestBuysFilter(ctx, options);
|
||||||
|
|
||||||
expect(results.length).toBe(2);
|
expect(results.length).toBe(4);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -84,7 +84,7 @@ describe('Entry latests buys filter()', () => {
|
||||||
|
|
||||||
const results = await models.Buy.latestBuysFilter(ctx, options);
|
const results = await models.Buy.latestBuysFilter(ctx, options);
|
||||||
|
|
||||||
expect(results.length).toBe(4);
|
expect(results.length).toBe(7);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -106,7 +106,7 @@ describe('Entry latests buys filter()', () => {
|
||||||
|
|
||||||
const results = await models.Buy.latestBuysFilter(ctx, options);
|
const results = await models.Buy.latestBuysFilter(ctx, options);
|
||||||
|
|
||||||
expect(results.length).toBe(4);
|
expect(results.length).toBe(7);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -128,7 +128,7 @@ describe('Entry latests buys filter()', () => {
|
||||||
|
|
||||||
const results = await models.Buy.latestBuysFilter(ctx, options);
|
const results = await models.Buy.latestBuysFilter(ctx, options);
|
||||||
|
|
||||||
expect(results.length).toBe(6);
|
expect(results.length).toBe(12);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -172,7 +172,7 @@ describe('Entry latests buys filter()', () => {
|
||||||
|
|
||||||
const results = await models.Buy.latestBuysFilter(ctx, options);
|
const results = await models.Buy.latestBuysFilter(ctx, options);
|
||||||
|
|
||||||
expect(results.length).toBe(5);
|
expect(results.length).toBe(11);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -238,7 +238,7 @@ describe('Entry latests buys filter()', () => {
|
||||||
|
|
||||||
const results = await models.Buy.latestBuysFilter(ctx, options);
|
const results = await models.Buy.latestBuysFilter(ctx, options);
|
||||||
|
|
||||||
expect(results.length).toBe(5);
|
expect(results.length).toBe(11);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -260,7 +260,7 @@ describe('Entry latests buys filter()', () => {
|
||||||
|
|
||||||
const results = await models.Buy.latestBuysFilter(ctx, options);
|
const results = await models.Buy.latestBuysFilter(ctx, options);
|
||||||
|
|
||||||
expect(results.length).toBe(6);
|
expect(results.length).toBe(12);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -282,7 +282,7 @@ describe('Entry latests buys filter()', () => {
|
||||||
|
|
||||||
const results = await models.Buy.latestBuysFilter(ctx, options);
|
const results = await models.Buy.latestBuysFilter(ctx, options);
|
||||||
|
|
||||||
expect(results.length).toBe(1);
|
expect(results.length).toBe(4);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const models = require('vn-loopback/server/server').models;
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
describe('item filter()', () => {
|
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 tx = await models.Item.beginTransaction({});
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ describe('item filter()', () => {
|
||||||
const ctx = {args: {filter: filter, search: 1}};
|
const ctx = {args: {filter: filter, search: 1}};
|
||||||
const result = await models.Item.filter(ctx, filter, options);
|
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);
|
expect(result[0].id).toEqual(1);
|
||||||
|
|
||||||
await tx.rollback();
|
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 tx = await models.Item.beginTransaction({});
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ describe('item filter()', () => {
|
||||||
const ctx = {args: {filter: filter, search: 4444444444}};
|
const ctx = {args: {filter: filter, search: 4444444444}};
|
||||||
const result = await models.Item.filter(ctx, filter, options);
|
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);
|
expect(result[0].id).toEqual(2);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
Loading…
Reference in New Issue