fix: testFront
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
86b7e9cabe
commit
40075e7e21
|
@ -273,7 +273,6 @@ class Controller extends Section {
|
|||
const hasChanges = sales.some(sale => {
|
||||
return sale.discount != newDiscount;
|
||||
});
|
||||
|
||||
if (newDiscount != null && hasChanges)
|
||||
this.updateDiscount(sales);
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue