diff --git a/modules/ticket/front/sale/index.spec.js b/modules/ticket/front/sale/index.spec.js index 28b3ce3dd..c8692f4e9 100644 --- a/modules/ticket/front/sale/index.spec.js +++ b/modules/ticket/front/sale/index.spec.js @@ -84,13 +84,13 @@ describe('Ticket', () => { describe('getSubTotal()', () => { it('should make an HTTP GET query and then set the subtotal property', () => { - const expectedAmount = 128; + const expectedResponse = {totalWithoutVat: 128}; - $httpBackend.expect('GET', 'Tickets/1/subtotal').respond(200, expectedAmount); + $httpBackend.expect('GET', 'Tickets/1').respond(200, expectedResponse); controller.getSubTotal(); $httpBackend.flush(); - expect(controller.subtotal).toEqual(expectedAmount); + expect(controller.subtotal).toEqual(expectedResponse.totalWithoutVat); }); }); @@ -125,13 +125,15 @@ describe('Ticket', () => { describe('getVat()', () => { it('should make an HTTP GET query and return the ticket VAT', () => { controller.edit = {}; - const expectedAmount = 67; + const expectedResponse = {totalWithVat: 1000, totalWithoutVat: 999}; - $httpBackend.expect('GET', 'Tickets/1/getVAT').respond(200, expectedAmount); + const expectedVAT = expectedResponse.totalWithVat - expectedResponse.totalWithoutVat; + + $httpBackend.expect('GET', 'Tickets/1').respond(200, expectedResponse); controller.getVat(); $httpBackend.flush(); - expect(controller.VAT).toEqual(expectedAmount); + expect(controller.VAT).toEqual(expectedVAT); }); });