diff --git a/modules/ticket/back/methods/sale/specs/payBack.spec.js b/modules/ticket/back/methods/sale/specs/refund.spec.js similarity index 100% rename from modules/ticket/back/methods/sale/specs/payBack.spec.js rename to modules/ticket/back/methods/sale/specs/refund.spec.js diff --git a/modules/ticket/front/descriptor-menu/index.spec.js b/modules/ticket/front/descriptor-menu/index.spec.js index faf45504e..71f1bbfe0 100644 --- a/modules/ticket/front/descriptor-menu/index.spec.js +++ b/modules/ticket/front/descriptor-menu/index.spec.js @@ -262,6 +262,19 @@ describe('Ticket Component vnTicketDescriptorMenu', () => { }); }); + describe('refundAll()', () => { + it('should make a query and show a go to ticket.card.sale', () => { + jest.spyOn(controller.$state, 'go').mockReturnValue('ok'); + const expectedParams = {ticketId: ticket.id}; + + $httpBackend.expect('POST', `Sales/refund`, expectedParams).respond({ticketId: 16}); + controller.refundAll(); + $httpBackend.flush(); + + expect(controller.$state.go).toHaveBeenCalledWith('ticket.card.sale', {id: {ticketId: ticket.id}}); + }); + }); + describe('showSMSDialog()', () => { it('should set the destionationFk and destination properties and then call the sms open() method', () => { controller.$.sms = {open: () => {}};