refs #6199 test: updateQuantity refactor
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-10-16 10:19:33 +02:00
parent b769fa9bcf
commit f79e711617
1 changed files with 3 additions and 2 deletions

View File

@ -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);