refs #5410 fix test
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-03-24 10:05:17 +01:00
parent 6c75853ce6
commit f689d35100
2 changed files with 3 additions and 5 deletions

View File

@ -145,9 +145,7 @@ export default class Controller extends Section {
}); });
} }
this.$http.post(`Mails`, params) .then(() => { this.$http.post(`Mails`, params);
this.vnApp.showMessage(this.$t('Email sended!'));
});
} }
exprBuilder(param, value) { exprBuilder(param, value) {

View File

@ -82,7 +82,7 @@ describe('client defaulter', () => {
const params = [{text: controller.defaulter.observation, clientFk: data[1].clientFk}]; 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'}]; 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('GET', `Defaulters/filter`).respond(200);
$httpBackend.expect('POST', `ClientObservations`, params).respond(200, params); $httpBackend.expect('POST', `ClientObservations`, params).respond(200, params);
$httpBackend.expect('POST', `Mails`, mailParams).respond(200); $httpBackend.expect('POST', `Mails`, mailParams).respond(200);
@ -90,7 +90,7 @@ describe('client defaulter', () => {
controller.onResponse(); controller.onResponse();
$httpBackend.flush(); $httpBackend.flush();
expect(controller.vnApp.showMessage).toHaveBeenCalledWith('Email sended!'); expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Observation saved!');
}); });
}); });