diff --git a/front/core/components/popover/index.js b/front/core/components/popover/index.js index 9e68d176e..9567102db 100644 --- a/front/core/components/popover/index.js +++ b/front/core/components/popover/index.js @@ -30,7 +30,7 @@ export default class Popover extends Popup { if (parent) this.parent = parent; if (direction) this.direction = direction; - console.log(direction); + super.show(); this.content = this.popup.querySelector('.content'); this.$timeout(() => this.relocate(), 10); @@ -60,7 +60,6 @@ export default class Popover extends Popup { * Repositions the popover to a correct location relative to the parent. */ relocate() { - console.log(this.direction); if (!(this.parent && this._shown && this.displayMode == 'relative')) return; diff --git a/modules/ticket/front/descriptor-menu/index.spec.js b/modules/ticket/front/descriptor-menu/index.spec.js index 5413545fe..e9486bcd0 100644 --- a/modules/ticket/front/descriptor-menu/index.spec.js +++ b/modules/ticket/front/descriptor-menu/index.spec.js @@ -138,6 +138,42 @@ describe('Ticket Component vnTicketDescriptorMenu', () => { }); }); + describe('showCsvDeliveryNote()', () => { + it('should make a query to the csv delivery-note download endpoint and show a message snackbar', () => { + jest.spyOn(window, 'open').mockReturnThis(); + + const expectedParams = { + ticketId: ticket.id, + recipientId: ticket.client.id + }; + const serializedParams = $httpParamSerializer(expectedParams); + const expectedPath = `api/csv/delivery-note/download?${serializedParams}`; + controller.showCsvDeliveryNote(); + + expect(window.open).toHaveBeenCalledWith(expectedPath); + }); + }); + + describe('sendCsvDeliveryNote()', () => { + it('should make a query to the csv delivery-note send endpoint and show a message snackbar', () => { + jest.spyOn(controller.vnApp, 'showMessage'); + + const $data = {email: 'brucebanner@gothamcity.com'}; + const expectedParams = { + ticketId: ticket.id, + recipient: $data.email, + recipientId: ticket.client.id, + }; + const serializedParams = $httpParamSerializer(expectedParams); + + $httpBackend.expectGET(`csv/delivery-note/send?${serializedParams}`).respond(); + controller.sendCsvDeliveryNote($data); + $httpBackend.flush(); + + expect(controller.vnApp.showMessage).toHaveBeenCalled(); + }); + }); + describe('makeInvoice()', () => { it('should make a query and call $state.reload() method', () => { jest.spyOn(controller, 'reload').mockReturnThis(); @@ -226,66 +262,4 @@ describe('Ticket Component vnTicketDescriptorMenu', () => { }); }); }); - - xdescribe('showCsvInvoice()', () => { - it('should make a query to the csv invoice download endpoint and show a message snackbar', () => { - jest.spyOn(window, 'open').mockReturnThis(); - - controller.invoiceOut = invoiceOut; - - const expectedParams = { - invoiceId: invoiceOut.id, - recipientId: invoiceOut.client.id - }; - const serializedParams = $httpParamSerializer(expectedParams); - const expectedPath = `api/csv/invoice/download?${serializedParams}`; - controller.showCsvInvoice(); - - expect(window.open).toHaveBeenCalledWith(expectedPath); - }); - }); - - xdescribe('sendPdfInvoice()', () => { - it('should make a query to the email invoice endpoint and show a message snackbar', () => { - jest.spyOn(controller.vnApp, 'showMessage'); - - controller.invoiceOut = invoiceOut; - - const $data = {email: 'brucebanner@gothamcity.com'}; - const expectedParams = { - invoiceId: invoiceOut.id, - recipient: $data.email, - recipientId: invoiceOut.client.id - }; - const serializedParams = $httpParamSerializer(expectedParams); - - $httpBackend.expectGET(`email/invoice?${serializedParams}`).respond(); - controller.sendPdfInvoice($data); - $httpBackend.flush(); - - expect(controller.vnApp.showMessage).toHaveBeenCalled(); - }); - }); - - xdescribe('sendCsvInvoice()', () => { - it('should make a query to the csv invoice send endpoint and show a message snackbar', () => { - jest.spyOn(controller.vnApp, 'showMessage'); - - controller.invoiceOut = invoiceOut; - - const $data = {email: 'brucebanner@gothamcity.com'}; - const expectedParams = { - invoiceId: invoiceOut.id, - recipient: $data.email, - recipientId: invoiceOut.client.id - }; - const serializedParams = $httpParamSerializer(expectedParams); - - $httpBackend.expectGET(`csv/invoice/send?${serializedParams}`).respond(); - controller.sendCsvInvoice($data); - $httpBackend.flush(); - - expect(controller.vnApp.showMessage).toHaveBeenCalled(); - }); - }); }); diff --git a/print/templates/reports/invoice/invoice.js b/print/templates/reports/invoice/invoice.js index 3e8734306..b56a5533c 100755 --- a/print/templates/reports/invoice/invoice.js +++ b/print/templates/reports/invoice/invoice.js @@ -95,7 +95,6 @@ module.exports = { }, ticketSubtotal(ticket) { let subTotal = 0.00; - console.log(ticket.sales); for (let sale of ticket.sales) subTotal += this.saleImport(sale);