diff --git a/modules/client/front/defaulter/index.js b/modules/client/front/defaulter/index.js index d8bf12bff..e084af650 100644 --- a/modules/client/front/defaulter/index.js +++ b/modules/client/front/defaulter/index.js @@ -145,9 +145,7 @@ export default class Controller extends Section { }); } - this.$http.post(`Mails`, params) .then(() => { - this.vnApp.showMessage(this.$t('Email sended!')); - }); + this.$http.post(`Mails`, params); } exprBuilder(param, value) { diff --git a/modules/client/front/defaulter/index.spec.js b/modules/client/front/defaulter/index.spec.js index 30c40132d..b9672802e 100644 --- a/modules/client/front/defaulter/index.spec.js +++ b/modules/client/front/defaulter/index.spec.js @@ -82,7 +82,7 @@ describe('client defaulter', () => { const params = [{text: controller.defaulter.observation, clientFk: data[1].clientFk}]; const mailParams = [{subject: 'Comment added to client', body: 'Added observation', receiver: 'undefined@verdnatura.es', replyTo: 'undefined@verdnatura.es'}]; - jest.spyOn(controller.vnApp, 'showMessage'); + jest.spyOn(controller.vnApp, 'showSuccess'); $httpBackend.expect('GET', `Defaulters/filter`).respond(200); $httpBackend.expect('POST', `ClientObservations`, params).respond(200, params); $httpBackend.expect('POST', `Mails`, mailParams).respond(200); @@ -90,7 +90,7 @@ describe('client defaulter', () => { controller.onResponse(); $httpBackend.flush(); - expect(controller.vnApp.showMessage).toHaveBeenCalledWith('Email sended!'); + expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Observation saved!'); }); });