fix: testFront
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-10-20 08:17:15 +02:00
parent 9ea427dbfe
commit 51cad75298
1 changed files with 12 additions and 16 deletions

View File

@ -83,29 +83,25 @@ describe('Ticket', () => {
agencyModeFk: 1,
warehouseFk: 1
};
const routeId = null;
controller.ticket = ticket;
const expectedTicket = {
clientId: 1101,
landed: new Date(),
addressId: 121,
agencyModeId: 1,
warehouseId: 1
};
const ticketIdToTransfer = 28;
const expectedResponse = {id: ticketIdToTransfer};
const ticketToTransfer = {id: 28};
const expectedParams = {
expeditionIds: [1, 2],
ticketId: 28
clientId: 1101,
landed: new Date(),
warehouseId: 1,
addressId: 121,
agencyModeId: 1,
routeId: null,
expeditionIds: [1, 2]
};
$httpBackend.expect('POST', 'Tickets/new', expectedTicket).respond(expectedResponse);
$httpBackend.expect('POST', 'Expeditions/moveExpeditions', expectedParams).respond(200);
controller.createTicket();
$httpBackend.expect('POST', 'Expeditions/moveExpeditions', expectedParams).respond(ticketToTransfer);
controller.createTicket(ticket.landed, routeId);
$httpBackend.flush();
expect(controller.$state.go).toHaveBeenCalledWith('ticket.card.summary', {id: ticketIdToTransfer});
expect(controller.$state.go).toHaveBeenCalledWith('ticket.card.summary', {id: ticketToTransfer.id});
});
});
});