BREACKING CHANGE: claim redirect to lilium #2843

Merged
alexm merged 8 commits from 6336-claim-redirectToLilium into dev 2024-08-08 10:43:39 +00:00
1 changed files with 9 additions and 3 deletions
Showing only changes of commit c768fa113e - Show all commits

View File

@ -295,20 +295,26 @@ describe('Ticket', () => {
describe('onCreateClaimAccepted()', () => {
it('should perform a query and call window open', () => {
jest.spyOn(controller, 'resetChanges').mockReturnThis();
jest.spyOn(controller.$state, 'go').mockReturnThis();
jest.spyOn(controller.vnApp, 'getUrl').mockReturnThis();
Object.defineProperty(window, 'location', {
value: {
href: () => {}
},
});
jest.spyOn(controller.window.location, 'href');
const newEmptySale = {quantity: 10};
controller.sales.push(newEmptySale);
const firstSale = controller.sales[0];
const claimId = 1;
firstSale.checked = true;
const expectedParams = {ticketId: 1, sales: [firstSale]};
$httpBackend.expect('POST', `Claims/createFromSales`, expectedParams).respond(200, {id: 1});
$httpBackend.expect('POST', `Claims/createFromSales`, expectedParams).respond(200, {id: claimId});
controller.onCreateClaimAccepted();
$httpBackend.flush();
expect(controller.resetChanges).toHaveBeenCalledWith();
expect(controller.$state.go).toHaveBeenCalledWith('claim.card.basicData', {id: 1});
});
});