fix: testFront
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-10-14 14:38:47 +02:00
parent 86b7e9cabe
commit 40075e7e21
2 changed files with 4 additions and 5 deletions

View File

@ -273,7 +273,6 @@ class Controller extends Section {
const hasChanges = sales.some(sale => {
return sale.discount != newDiscount;
});
if (newDiscount != null && hasChanges)
this.updateDiscount(sales);

View File

@ -393,7 +393,7 @@ describe('Ticket', () => {
secondSelectedSale.checked = true;
const expectedSales = [firstSelectedSale, secondSelectedSale];
controller.$.editDiscountDialog = {hide: jest.fn()};
controller.$.editDiscount = {hide: jest.fn()};
controller.edit = {
discount: 10,
sales: expectedSales
@ -402,7 +402,7 @@ describe('Ticket', () => {
controller.changeMultipleDiscount();
expect(controller.updateDiscount).toHaveBeenCalledWith(expectedSales);
expect(controller.$.editDiscountDialog.hide).toHaveBeenCalledWith();
expect(controller.$.editDiscount.hide).toHaveBeenCalledWith();
});
it('should not call to the updateDiscount() method and then to the editDiscountDialog hide() method', () => {
@ -417,7 +417,7 @@ describe('Ticket', () => {
secondSelectedSale.discount = 10;
const expectedSales = [firstSelectedSale, secondSelectedSale];
controller.$.editDiscountDialog = {hide: jest.fn()};
controller.$.editDiscount = {hide: jest.fn()};
controller.edit = {
discount: 10,
sales: expectedSales
@ -426,7 +426,7 @@ describe('Ticket', () => {
controller.changeMultipleDiscount();
expect(controller.updateDiscount).not.toHaveBeenCalledWith(expectedSales);
expect(controller.$.editDiscountDialog.hide).toHaveBeenCalledWith();
expect(controller.$.editDiscount.hide).toHaveBeenCalledWith();
});
});