diff --git a/e2e/paths/client-module/03_edit_fiscal_data.spec.js b/e2e/paths/client-module/03_edit_fiscal_data.spec.js index d837d817e..d424f0591 100644 --- a/e2e/paths/client-module/03_edit_fiscal_data.spec.js +++ b/e2e/paths/client-module/03_edit_fiscal_data.spec.js @@ -58,20 +58,19 @@ describe('Client Edit fiscalData path', () => { .accessToSection('client.card.fiscalData'); }); - it('should edit the fiscal data', async() => { + it(`should edit the fiscal data but fail as the fiscal id ain't valid`, async() => { const result = await nightmare .wait(selectors.clientFiscalData.socialNameInput) .clearInput(selectors.clientFiscalData.socialNameInput) .write(selectors.clientFiscalData.socialNameInput, 'SMASH!') .clearInput(selectors.clientFiscalData.fiscalIdInput) - .write(selectors.clientFiscalData.fiscalIdInput, '94980061C') + .write(selectors.clientFiscalData.fiscalIdInput, 'INVALID!') .clearInput(selectors.clientFiscalData.addressInput) .write(selectors.clientFiscalData.addressInput, 'Somewhere edited') .clearInput(selectors.clientFiscalData.postcodeInput) .write(selectors.clientFiscalData.postcodeInput, '12345') .clearInput(selectors.clientFiscalData.cityInput) .write(selectors.clientFiscalData.cityInput, 'N/A') - .autocompleteSearch(selectors.clientFiscalData.countryAutocomplete, 'Francia') .autocompleteSearch(selectors.clientFiscalData.provinceAutocomplete, 'Province two') .waitToClick(selectors.clientFiscalData.activeCheckbox) .waitToClick(selectors.clientFiscalData.frozenCheckbox) @@ -84,9 +83,19 @@ describe('Client Edit fiscalData path', () => { .waitToClick(selectors.clientFiscalData.saveButton) .waitForLastSnackbar(); - expect(result).toEqual('Data saved!'); + expect(result).toEqual('Invalid Tax number'); }, 15000); + it(`should edit the fiscal this time with a valid fiscal id`, async() => { + const result = await nightmare + .clearInput(selectors.clientFiscalData.fiscalIdInput) + .write(selectors.clientFiscalData.fiscalIdInput, '94980061C') + .waitToClick(selectors.clientFiscalData.saveButton) + .waitForLastSnackbar(); + + expect(result).toEqual('Data saved!'); + }); + it('should propagate the Equalization tax', async() => { const result = await nightmare .waitToClick(selectors.clientFiscalData.acceptPropagationButton) @@ -200,13 +209,6 @@ describe('Client Edit fiscalData path', () => { expect(result).toEqual('N/A'); }); - it(`should confirm the country have been selected`, async() => { - const result = await nightmare - .waitToGetProperty(`${selectors.clientFiscalData.countryAutocomplete} input`, 'value'); - - expect(result).toEqual('Francia'); - }); - it(`should confirm the province have been selected`, async() => { const result = await nightmare .waitToGetProperty(`${selectors.clientFiscalData.provinceAutocomplete} input`, 'value'); diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 7fbc0bb9c..b323c1c36 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -40,5 +40,6 @@ "Street cannot be empty": "Street cannot be empty", "City cannot be empty": "City cannot be empty", "EXTENSION_INVALID_FORMAT": "Invalid extension", - "The secret can't be blank": "The secret can't be blank" + "The secret can't be blank": "The secret can't be blank", + "Invalid TIN": "Invalid Tax number" } \ No newline at end of file diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 6c1d9d025..f8c08591c 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -5,7 +5,7 @@ "The default consignee can not be unchecked": "No se puede desmarcar el consignatario predeterminado", "Unable to default a disabled consignee": "No se puede poner predeterminado un consignatario desactivado", "Can't be blank": "No puede estar en blanco", - "Invalid TIN": "DNI Incorrecto", + "Invalid TIN": "NIF/CIF invalido", "TIN must be unique": "El NIF/CIF debe ser Ășnico", "A client with that Web User name already exists": "Ya existe un cliente con ese Usuario Web", "Is invalid": "Is invalid",