2167-entry_buy #613
|
@ -14,10 +14,20 @@ describe('sale deleteBuys()', () => {
|
||||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||||
active: activeCtx
|
active: activeCtx
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const tx = await app.models.Entry.beginTransaction({});
|
||||||
|
const options = {transaction: tx};
|
||||||
|
|
||||||
ctx.args = {buys: [{id: 1}]};
|
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;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue