From fb798f4300b36e1eac5576104bb2baaba018070f Mon Sep 17 00:00:00 2001 From: carlosjr Date: Mon, 25 Jan 2021 09:28:01 +0100 Subject: [PATCH] regenerate invoice added to descriptor path --- e2e/helpers/selectors.js | 1 + e2e/paths/05-ticket/12_descriptor.spec.js | 16 ++++++++++++++-- modules/ticket/front/descriptor-menu/index.html | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index ad81b9b3a..0ff57b2d6 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -432,6 +432,7 @@ export default { moreMenuDeleteTicket: '.vn-menu [name="deleteTicket"]', moreMenuRestoreTicket: '.vn-menu [name="restoreTicket"]', moreMenuMakeInvoice: '.vn-menu [name="makeInvoice"]', + moreMenuRegenerateInvoice: '.vn-menu [name="regenerateInvoice"]', moreMenuChangeShippedHour: '.vn-menu [name="changeShipped"]', moreMenuPaymentSMS: '.vn-menu [name="sendPaymentSms"]', moreMenuSendImportSms: '.vn-menu [name="sendImportSms"]', diff --git a/e2e/paths/05-ticket/12_descriptor.spec.js b/e2e/paths/05-ticket/12_descriptor.spec.js index 1c7895382..471d7a536 100644 --- a/e2e/paths/05-ticket/12_descriptor.spec.js +++ b/e2e/paths/05-ticket/12_descriptor.spec.js @@ -129,10 +129,10 @@ describe('Ticket descriptor path', () => { }); describe('Make invoice', () => { - it('should login as adminBoss role then search for a ticket', async() => { + it('should login as administrative role then search for a ticket', async() => { const invoiceableTicketId = '14'; - await page.loginAndModule('adminBoss', 'ticket'); + await page.loginAndModule('administrative', 'ticket'); await page.accessToSearchResult(invoiceableTicketId); await page.waitForState('ticket.card.summary'); }); @@ -160,6 +160,18 @@ describe('Ticket descriptor path', () => { expect(result).toEqual('T4444445'); }); + + it(`should regenerate the invoice using the descriptor menu`, async() => { + const expectedMessage = 'Invoice sent for a regeneration, will be available in a few minutes'; + + await page.waitToClick(selectors.ticketDescriptor.moreMenu); + await page.waitForContentLoaded(); + await page.waitToClick(selectors.ticketDescriptor.moreMenuRegenerateInvoice); + await page.respondToDialog('accept'); + const message = await page.waitForSnackbar(); + + expect(message.text).toContain(expectedMessage); + }); }); describe('SMS', () => { diff --git a/modules/ticket/front/descriptor-menu/index.html b/modules/ticket/front/descriptor-menu/index.html index 075b97766..80ad71d5f 100644 --- a/modules/ticket/front/descriptor-menu/index.html +++ b/modules/ticket/front/descriptor-menu/index.html @@ -84,6 +84,7 @@ ng-show="$ctrl.isInvoiced" vn-acl="invoicing" vn-acl-action="remove" + name="regenerateInvoice" translate> Regenerate invoice