diff --git a/modules/ticket/front/sale/editDiscount.js b/modules/ticket/front/sale/editDiscount.js index 0e3fb7395..b3403d722 100644 --- a/modules/ticket/front/sale/editDiscount.js +++ b/modules/ticket/front/sale/editDiscount.js @@ -11,7 +11,7 @@ class Controller { set edit(value) { this._edit = value; - this.clear(); + this.clearDiscount(); this.setNewDiscount(); } @@ -48,8 +48,9 @@ class Controller { const query = `/api/Tickets/${this.$state.params.id}/updateDiscount`; this.$http.post(query, params).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); - this.clear(); + this.clearDiscount(); modified = false; + this.vnTicketSale.$scope.model.refresh(); }).catch(e => { this.vnApp.showError(e.data.error.message); }); @@ -59,7 +60,7 @@ class Controller { this.vnApp.showError(this.$translate.instant('There are no changes to save')); } - clear() { + clearDiscount() { this.newDiscount = null; } } @@ -74,5 +75,8 @@ ngModule.component('vnTicketSaleEditDiscount', { mana: ' { describe('Component vnTicketSaleEditDiscount', () => { @@ -75,9 +75,9 @@ describe('Ticket', () => { }); }); - describe('clear()', () => { + describe('clearDiscount()', () => { it('should set newDiscount to null', () => { - controller.clear(); + controller.clearDiscount(); expect(controller.newDiscount).toEqual(null); }); diff --git a/modules/ticket/front/sale/index.spec.js b/modules/ticket/front/sale/specs/index.spec.js similarity index 99% rename from modules/ticket/front/sale/index.spec.js rename to modules/ticket/front/sale/specs/index.spec.js index 9661c8a09..b1cadd0fc 100644 --- a/modules/ticket/front/sale/index.spec.js +++ b/modules/ticket/front/sale/specs/index.spec.js @@ -1,4 +1,4 @@ -import './index.js'; +import '../index.js'; describe('Ticket', () => { describe('Component vnTicketSale', () => {