From abd2d9a849ba76366f3b7c59f5c580d9fc2c43c8 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 19 Oct 2022 15:10:43 +0200 Subject: [PATCH] fix: e2e --- e2e/helpers/selectors.js | 1 + e2e/paths/09-invoice-out/04_globalInvoice.spec.js | 12 ++++++++++++ .../front/index/global-invoicing/index.spec.js | 8 -------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index cd6d39795..a678da583 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -954,6 +954,7 @@ export default { manualInvoiceTaxArea: 'vn-autocomplete[ng-model="$ctrl.invoice.taxArea"]', saveInvoice: 'button[response="accept"]', globalInvoiceForm: '.vn-invoice-out-global-invoicing', + globalInvoiceClientsRange: 'vn-radio[val="clientsRange"]', globalInvoiceDate: '[ng-model="$ctrl.invoice.invoiceDate"]', globalInvoiceFromClient: '[ng-model="$ctrl.invoice.fromClientId"]', globalInvoiceToClient: '[ng-model="$ctrl.invoice.toClientId"]', diff --git a/e2e/paths/09-invoice-out/04_globalInvoice.spec.js b/e2e/paths/09-invoice-out/04_globalInvoice.spec.js index b62c889db..74efafd2d 100644 --- a/e2e/paths/09-invoice-out/04_globalInvoice.spec.js +++ b/e2e/paths/09-invoice-out/04_globalInvoice.spec.js @@ -33,6 +33,7 @@ describe('InvoiceOut global invoice path', () => { it('should create a global invoice for charles xavier today', async() => { await page.pickDate(selectors.invoiceOutIndex.globalInvoiceDate); + await page.waitToClick(selectors.invoiceOutIndex.globalInvoiceClientsRange); await page.autocompleteSearch(selectors.invoiceOutIndex.globalInvoiceFromClient, 'Petter Parker'); await page.autocompleteSearch(selectors.invoiceOutIndex.globalInvoiceToClient, 'Petter Parker'); await page.waitToClick(selectors.invoiceOutIndex.saveInvoice); @@ -48,4 +49,15 @@ describe('InvoiceOut global invoice path', () => { expect(currentInvoices).toBeGreaterThan(invoicesBefore); }); + + it('should create a global invoice for all clients today', async() => { + await page.waitToClick(selectors.invoiceOutIndex.createInvoice); + await page.waitToClick(selectors.invoiceOutIndex.createGlobalInvoice); + await page.waitForSelector(selectors.invoiceOutIndex.globalInvoiceForm); + await page.pickDate(selectors.invoiceOutIndex.globalInvoiceDate); + await page.waitToClick(selectors.invoiceOutIndex.saveInvoice); + const message = await page.waitForSnackbar(); + + expect(message.text).toContain('Data saved!'); + }); }); diff --git a/modules/invoiceOut/front/index/global-invoicing/index.spec.js b/modules/invoiceOut/front/index/global-invoicing/index.spec.js index 1e5ed3a99..6e3721f9e 100644 --- a/modules/invoiceOut/front/index/global-invoicing/index.spec.js +++ b/modules/invoiceOut/front/index/global-invoicing/index.spec.js @@ -108,14 +108,6 @@ describe('InvoiceOut', () => { clientsAndAddresses: [{clientId: 1101, addressId: 121}], invoice: controller.invoice }; - const expectedParams = { - clientId: 1101, - addressId: 121, - invoiceDate: new Date(), - maxShipped: new Date(), - companyFk: 442, - minShipped: minShipped - }; const serializedParams = $httpParamSerializer({filter}); $httpBackend.expectGET(`Clients/findOne?${serializedParams}`).respond(200, {id: 1112});