diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index d8ebaa069..84f5cdd0f 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -556,6 +556,7 @@ export default { moreMenuReserve: 'vn-item[name="reserve"]', moreMenuUnmarkReseved: 'vn-item[name="unreserve"]', moreMenuUpdateDiscount: 'vn-item[name="discount"]', + moreMenuRecalculatePrice: 'vn-item[name="calculatePrice"]', moreMenuUpdateDiscountInput: 'vn-input-number[ng-model="$ctrl.edit.discount"] input', transferQuantityInput: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable > span > text', transferQuantityCell: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable', diff --git a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js index 55bbdf9ff..dfda4dcfb 100644 --- a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js +++ b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js @@ -195,6 +195,17 @@ describe('Ticket Edit sale path', () => { expect(result).toContain('22.50'); }); + it('should recalculate price of sales', async() => { + await page.waitToClick(selectors.ticketSales.firstSaleCheckbox); + await page.waitToClick(selectors.ticketSales.secondSaleCheckbox); + + await page.waitToClick(selectors.ticketSales.moreMenu); + await page.waitToClick(selectors.ticketSales.moreMenuRecalculatePrice); + const message = await page.waitForSnackbar(); + + expect(message.text).toContain('Data saved!'); + }); + it('should select the third sale and create a claim of it', async() => { await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox); await page.waitToClick(selectors.ticketSales.moreMenu); diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index 996135c1e..f7a279d9a 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -464,7 +464,7 @@ + ng-if="$ctrl.isEditable"> Recalculate price { - this.vnApp.showSuccess(this.$t('Data saved!')); - this.$.model.refresh(); + const sales = this.selectedValidSales(); + sales.forEach(sale => { + this.$http.post(`Sales/${sale.id}/recalculatePrice`); }); + this.vnApp.showSuccess(this.$t('Data saved!')); + this.$.model.refresh(); } itemSearchFunc($search) {