This commit is contained in:
parent
111480f7b7
commit
69e1df2504
|
@ -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() => {
|
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({});
|
const tx = await models.Sale.beginTransaction({});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue