#1486 back test updateDiscount
gitea/salix/dev This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-06-05 15:20:56 +02:00
parent 7bcd4b53e5
commit 55ea445f02
1 changed files with 2 additions and 11 deletions

View File

@ -20,7 +20,7 @@ describe('sale updateDiscount()', () => {
afterAll(async done => {
await originalSale.save();
await createdSaleComponent.destroy();
await app.models.SaleComponent.updateAll({componentFk: componentId, saleFk: originalSaleId}, {value: 0});
await salesPersonMana.save();
done();
@ -73,15 +73,6 @@ describe('sale updateDiscount()', () => {
});
it('should update the discount if the salesPerson has mana', async() => {
createdSaleComponent = await app.models.SaleComponent.findOne({
where: {
componentFk: componentId,
saleFk: originalSaleId
}
});
expect(createdSaleComponent).toBeNull();
const ticketId = 8;
const sales = [originalSaleId];
const newDiscount = 100;
@ -89,7 +80,7 @@ describe('sale updateDiscount()', () => {
await app.models.Ticket.updateDiscount(ticketId, sales, newDiscount);
let updatedSale = await app.models.Sale.findById(originalSaleId);
createdSaleComponent = await app.models.SaleComponent.findOne({
let createdSaleComponent = await app.models.SaleComponent.findOne({
where: {
componentFk: componentId,
saleFk: originalSaleId