#1228e2e verifiedData solo cuando el NIF correto

This commit is contained in:
Carlos Jimenez Ruiz 2019-04-01 10:00:15 +02:00
parent 03d8e96deb
commit b483ccba27
3 changed files with 16 additions and 13 deletions

View File

@ -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');

View File

@ -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"
}

View File

@ -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",