Updated unit tests
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-07-01 14:03:28 +02:00
parent 319a168b89
commit 3246101574
3 changed files with 5 additions and 3 deletions

View File

@ -87,7 +87,7 @@ describe('ticket makeInvoice()', () => {
await tx.rollback();
}
expect(error.message).toEqual(`One or more tickets are not billable`);
expect(error.message).toEqual(`Some of the selected tickets are not billable`);
});
it('should success to invoice a ticket', async() => {

View File

@ -217,7 +217,8 @@ class Controller extends Section {
}
makeInvoice() {
return this.$http.post(`Tickets/${this.id}/makeInvoice`)
const params = {ticketsIds: [this.id]};
return this.$http.post(`Tickets/makeInvoice`, params)
.then(() => this.reload())
.then(() => this.vnApp.showSuccess(this.$t('Ticket invoiced')));
}

View File

@ -139,7 +139,8 @@ describe('Ticket Component vnTicketDescriptorMenu', () => {
jest.spyOn(controller, 'reload').mockReturnThis();
jest.spyOn(controller.vnApp, 'showSuccess');
$httpBackend.expectPOST(`Tickets/${ticket.id}/makeInvoice`).respond();
const expectedParams = {ticketsIds: [ticket.id]};
$httpBackend.expectPOST(`Tickets/makeInvoice`, expectedParams).respond();
controller.makeInvoice();
$httpBackend.flush();