From a37fdd1e332fa3b1f4c1893f437b0ada9d429a92 Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 26 Feb 2019 17:32:58 +0100 Subject: [PATCH] EQTAX restriction deleted CR Javi --- .../client-module/03_edit_fiscal_data.spec.js | 29 ------------------- modules/client/back/models/client.js | 9 ------ 2 files changed, 38 deletions(-) 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 e8b4ada00..e1ca583df 100644 --- a/e2e/paths/client-module/03_edit_fiscal_data.spec.js +++ b/e2e/paths/client-module/03_edit_fiscal_data.spec.js @@ -58,35 +58,6 @@ describe('Client Edit fiscalData path', () => { .accessToSection('client.card.fiscalData'); }); - it('should receive an error if VIES and EQtax are being ticked together', 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') - .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) - .waitToClick(selectors.clientFiscalData.hasToInvoiceCheckbox) - .waitToClick(selectors.clientFiscalData.viesCheckbox) - .waitToClick(selectors.clientFiscalData.invoiceByMailCheckbox) - .waitToClick(selectors.clientFiscalData.invoiceByAddressCheckbox) - .waitToClick(selectors.clientFiscalData.equalizationTaxCheckbox) - .waitToClick(selectors.clientFiscalData.verifiedDataCheckbox) - .waitToClick(selectors.clientFiscalData.saveButton) - .waitForLastSnackbar(); - - expect(result).toEqual('Cannot check VIES and Equalization Tax'); - }, 15000); - it('should receive an error if the fiscal id contains A or B at the beginning', async() => { const result = await nightmare .waitToClick(selectors.clientFiscalData.viesCheckbox) diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index 3de4a4a66..1fd44b9c8 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -90,15 +90,6 @@ module.exports = Self => { err(); } - Self.validate('isVies', hasEquTax, { - message: 'Cannot check VIES and Equalization Tax' - }); - - function hasEquTax(err) { - if (this.isVies && this.isEqualizated) - err(); - } - Self.validate('isEqualizated', cannotHaveET, { message: 'Cannot check Equalization Tax in this NIF/CIF' });