feat: 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
1c6a5164d4
commit
14eba75a8e
|
@ -57,4 +57,44 @@ describe('claim filter()', () => {
|
|||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
it('should return 3 results filtering by item id', async() => {
|
||||
const tx = await app.models.Claim.beginTransaction({});
|
||||
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
||||
const result = await app.models.Claim.filter({args: {filter: {}, itemFk: 2}}, null, options);
|
||||
|
||||
expect(result.length).toEqual(3);
|
||||
expect(result[0].id).toEqual(1);
|
||||
expect(result[1].id).toEqual(2);
|
||||
expect(result[2].id).toEqual(4);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
it('should return 3 results filtering by claimResponsible id', async() => {
|
||||
const tx = await app.models.Claim.beginTransaction({});
|
||||
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
||||
const result = await app.models.Claim.filter({args: {filter: {}, claimResponsibleFk: 7}}, null, options);
|
||||
|
||||
expect(result.length).toEqual(3);
|
||||
expect(result[0].id).toEqual(2);
|
||||
expect(result[1].id).toEqual(3);
|
||||
expect(result[2].id).toEqual(4);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue