Updated unit tests
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
319a168b89
commit
3246101574
|
@ -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() => {
|
||||
|
|
|
@ -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')));
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue