This commit is contained in:
parent
6c75853ce6
commit
f689d35100
|
@ -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) {
|
||||||
|
|
|
@ -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!');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue