2167-entry_buy #613

Merged
joan merged 9 commits from 2167-entry_buy into dev 2021-04-29 07:11:33 +00:00
1 changed files with 12 additions and 2 deletions
Showing only changes of commit e53298f35c - Show all commits

View File

@ -14,10 +14,20 @@ describe('sale deleteBuys()', () => {
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
active: activeCtx
});
const tx = await app.models.Entry.beginTransaction({});
const options = {transaction: tx};
ctx.args = {buys: [{id: 1}]};
let result = await app.models.Buy.deleteBuys(ctx);
try {
const result = await app.models.Buy.deleteBuys(ctx, options);
expect(result).toEqual([{count: 1}]);
expect(result).toEqual([{count: 1}]);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});