This commit is contained in:
parent
b769fa9bcf
commit
f79e711617
|
@ -174,14 +174,15 @@ describe('sale updateQuantity()', () => {
|
|||
const tx = await models.Sale.beginTransaction({});
|
||||
const itemId = 2;
|
||||
const saleId = 17;
|
||||
const newQuantity = 29;
|
||||
const minQuantity = 30;
|
||||
const newQuantity = minQuantity - 1;
|
||||
|
||||
let error;
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
||||
const item = await models.Item.findById(itemId, null, options);
|
||||
await item.updateAttribute('minQuantity', 30, options);
|
||||
await item.updateAttribute('minQuantity', minQuantity, options);
|
||||
|
||||
await models.Sale.updateQuantity(ctx, saleId, newQuantity, options);
|
||||
|
||||
|
|
Loading…
Reference in New Issue