fix: refs #235425 Requested changes
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-10-25 08:47:43 +02:00
parent 111480f7b7
commit 69e1df2504
1 changed files with 19 additions and 0 deletions

View File

@ -85,6 +85,25 @@ describe('sale updatePrice()', () => {
}
});
it('should check if priceFixed has changed', async() => {
const tx = await models.Sale.beginTransaction({});
try {
const options = {transaction: tx};
const price = 3;
const beforeUpdate = await models.Sale.findById(saleId, null, options);
await models.Sale.updatePrice(ctx, saleId, price, options);
const afterUpdate = await models.Sale.findById(saleId, null, options);
expect(beforeUpdate.priceFixed).not.toEqual(afterUpdate.priceFixed);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
it('should set price as a decimal number and check the sale has the mana component changing the salesPersonMana', async() => {
const tx = await models.Sale.beginTransaction({});