From 7f745de314b2987a7040fdc2be555afaf30bf15e Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 7 Jan 2019 16:53:34 +0100 Subject: [PATCH 1/3] #927 order.basic-data --- loopback/locale/es.json | 3 ++- modules/order/front/basic-data/index.html | 9 +-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index f33e4b692..64d8e4e45 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -60,5 +60,6 @@ "You must delete the claim id %d first": "Antes debes borrar la reclamacion %d", "You don't have enough privileges": "You don't have enough privileges", "Cannot check VIES and Equalization Tax": "No puedes marcar VIES y RE al mismo", - "Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF" + "Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF", + "You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos" } \ No newline at end of file diff --git a/modules/order/front/basic-data/index.html b/modules/order/front/basic-data/index.html index d4c4fe123..6e191f454 100644 --- a/modules/order/front/basic-data/index.html +++ b/modules/order/front/basic-data/index.html @@ -10,7 +10,6 @@ Basic data @@ -40,16 +37,12 @@ - - This form has been disabled because there are lines in this order or it's confirmed - - + From bbb242b728cda59949e118e21c6f52b2d098d436 Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 8 Jan 2019 08:36:08 +0100 Subject: [PATCH 2/3] #948 alta de cliente --- loopback/locale/es.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 64d8e4e45..a244b5ae6 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -61,5 +61,6 @@ "You don't have enough privileges": "You don't have enough privileges", "Cannot check VIES and Equalization Tax": "No puedes marcar VIES y RE al mismo", "Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF", - "You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos" + "You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos", + "INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ" } \ No newline at end of file From c3d23fb657e6305af1e7e75da811573ffb4c2c6b Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 8 Jan 2019 12:02:38 +0100 Subject: [PATCH 3/3] #891 e2e order.basic-data --- .../order-module/02_edit_basic_data.spec.js | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 e2e/paths/order-module/02_edit_basic_data.spec.js diff --git a/e2e/paths/order-module/02_edit_basic_data.spec.js b/e2e/paths/order-module/02_edit_basic_data.spec.js new file mode 100644 index 000000000..834503ab7 --- /dev/null +++ b/e2e/paths/order-module/02_edit_basic_data.spec.js @@ -0,0 +1,92 @@ +import selectors from '../../helpers/selectors.js'; +import createNightmare from '../../helpers/nightmare'; + +fdescribe('Order Edit basicData path', () => { + const nightmare = createNightmare(); + describe('when confirmed order', () => { + beforeAll(() => { + nightmare + .loginAndModule('employee', 'order') + .accessToSearchResult('1') + .accessToSection('order.card.basicData'); + }); + + it('should not be able to change the client', async() => { + const result = await nightmare + .autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark') + .click(selectors.orderBasicData.saveButton) + .waitForLastSnackbar(); + + expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`); + }); + }); + + describe('when order with rows', () => { + it('should now navigate to order index', async() => { + const url = await nightmare + .waitToClick(selectors.globalItems.returnToModuleIndexButton) + .waitToClick(selectors.globalItems.acceptVnConfirm) + .wait(selectors.ordersIndex.createOrderButton) + .accessToSearchResult('16') + .accessToSection('order.card.basicData') + .wait(selectors.orderBasicData.companyAutocomplete) + .parsedUrl(); + + expect(url.hash).toEqual('#!/order/16/basic-data'); + }); + + it('should not be able to change the company', async() => { + const result = await nightmare + .autocompleteSearch(selectors.orderBasicData.companyAutocomplete, 'CCs') + .click(selectors.orderBasicData.saveButton) + .waitForLastSnackbar(); + + expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`); + }); + }); + + describe('when new order', () => { + beforeAll(() => { + nightmare + .loginAndModule('employee', 'order') + .accessToSearchResult('18') + .accessToSection('order.card.basicData'); + }); + + it('should be able to modify all the properties', async() => { + const result = await nightmare + .autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark') + .autocompleteSearch(selectors.orderBasicData.companyAutocomplete, 'CCs') + .clearInput(selectors.orderBasicData.observationInput) + .type(selectors.orderBasicData.observationInput, 'Observation modified') + .click(selectors.orderBasicData.saveButton) + .waitForLastSnackbar(); + + expect(result).toEqual('Data saved!'); + }); + + it('should now confirm the client have been edited', async() => { + const result = await nightmare + .click(selectors.orderCatalog.catalogButton) + .wait(selectors.orderCatalog.orderByAutocomplete) + .click(selectors.orderBasicData.basicDataButton) + .waitToGetProperty(`${selectors.orderBasicData.clientAutocomplete} input`, 'value'); + + expect(result).toEqual('104: Tony Stark'); + }); + + it('should now confirm the comany have been edited', async() => { + const result = await nightmare + .waitToGetProperty(`${selectors.orderBasicData.companyAutocomplete} input`, 'value'); + + expect(result).toEqual('CCs'); + }); + + it('should now confirm the observations have been edited', async() => { + const result = await nightmare + .waitToGetProperty(selectors.orderBasicData.observationInput, 'value'); + + expect(result).toEqual('Observation modified'); + }); + }); +});