refactr: update test
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2022-04-04 13:56:36 +02:00
parent 5f2424dc44
commit c5efc17fe9
2 changed files with 13 additions and 0 deletions

View File

@ -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()', () => { describe('showSMSDialog()', () => {
it('should set the destionationFk and destination properties and then call the sms open() method', () => { it('should set the destionationFk and destination properties and then call the sms open() method', () => {
controller.$.sms = {open: () => {}}; controller.$.sms = {open: () => {}};