#822 E2E client.fiscal-data
This commit is contained in:
parent
ccc8fae1b1
commit
f90bad0719
|
@ -5,7 +5,7 @@ describe('Client Edit fiscalData path', () => {
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
describe('as employee', () => {
|
describe('as employee', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
return nightmare
|
nightmare
|
||||||
.waitForLogin('employee');
|
.waitForLogin('employee');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ describe('Client Edit fiscalData path', () => {
|
||||||
|
|
||||||
describe('as administrative', () => {
|
describe('as administrative', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
return nightmare
|
nightmare
|
||||||
.waitForLogin('administrative');
|
.waitForLogin('administrative');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -126,12 +126,11 @@ describe('Client Edit fiscalData path', () => {
|
||||||
expect(url).toContain('fiscal-data');
|
expect(url).toContain('fiscal-data');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should edit the clients fiscal data', async () => {
|
it('should receive an error if VIES and EQtax are being ticked together', async () => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.wait(selectors.clientFiscalData.socialNameInput)
|
.wait(selectors.clientFiscalData.socialNameInput)
|
||||||
.clearInput(selectors.clientFiscalData.socialNameInput)
|
.clearInput(selectors.clientFiscalData.socialNameInput)
|
||||||
.type(selectors.clientFiscalData.socialNameInput, 'SMASH!')
|
.type(selectors.clientFiscalData.socialNameInput, 'SMASH!')
|
||||||
.waitForTextInInput(selectors.clientFiscalData.socialNameInput, 'SMASH!')
|
|
||||||
.clearInput(selectors.clientFiscalData.fiscalIdInput)
|
.clearInput(selectors.clientFiscalData.fiscalIdInput)
|
||||||
.type(selectors.clientFiscalData.fiscalIdInput, '94980061C')
|
.type(selectors.clientFiscalData.fiscalIdInput, '94980061C')
|
||||||
.clearInput(selectors.clientFiscalData.addressInput)
|
.clearInput(selectors.clientFiscalData.addressInput)
|
||||||
|
@ -147,13 +146,33 @@ describe('Client Edit fiscalData path', () => {
|
||||||
.waitToClick(selectors.clientFiscalData.activeCheckboxLabel)
|
.waitToClick(selectors.clientFiscalData.activeCheckboxLabel)
|
||||||
.waitToClick(selectors.clientFiscalData.frozenCheckboxLabel)
|
.waitToClick(selectors.clientFiscalData.frozenCheckboxLabel)
|
||||||
.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckboxLabel)
|
.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckboxLabel)
|
||||||
// .waitToClick(selectors.clientFiscalData.viesCheckboxInput)
|
.waitToClick(selectors.clientFiscalData.viesCheckboxInput)
|
||||||
// Petición #822 creada.
|
|
||||||
.waitToClick(selectors.clientFiscalData.invoiceByMailCheckboxLabel)
|
.waitToClick(selectors.clientFiscalData.invoiceByMailCheckboxLabel)
|
||||||
.waitToClick(selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
.waitToClick(selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
||||||
.waitToClick(selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
.waitToClick(selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
||||||
.waitToClick(selectors.clientFiscalData.verifiedDataCheckboxInput)
|
.waitToClick(selectors.clientFiscalData.verifiedDataCheckboxInput)
|
||||||
.click(selectors.clientFiscalData.saveButton)
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual('Cannot check VIES and Equalization Tax');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should receive an error if the fiscal id contains A or B at the beginning', async () => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitToClick(selectors.clientFiscalData.viesCheckboxInput)
|
||||||
|
.clearInput(selectors.clientFiscalData.fiscalIdInput)
|
||||||
|
.type(selectors.clientFiscalData.fiscalIdInput, 'A94980061C')
|
||||||
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual('Cannot check Equalization Tax in this NIF/CIF');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should finally edit the fixcal data correctly as VIES isnt checked and fiscal id is valid for EQtax', async () => {
|
||||||
|
const result = await nightmare
|
||||||
|
.clearInput(selectors.clientFiscalData.fiscalIdInput)
|
||||||
|
.type(selectors.clientFiscalData.fiscalIdInput, '94980061C')
|
||||||
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
.waitForLastSnackbar();
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
expect(result).toEqual('Data saved!');
|
expect(result).toEqual('Data saved!');
|
||||||
|
@ -202,7 +221,26 @@ describe('Client Edit fiscalData path', () => {
|
||||||
expect(result).toBeTruthy();
|
expect(result).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should navigate back to fiscal data to confirm its name have been edited', async () => {
|
it('should navigate back to fiscal data and uncheck EQtax then check VIES', async () => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
|
.waitToClick(selectors.clientFiscalData.viesCheckboxInput)
|
||||||
|
.waitToClick(selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
||||||
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual('Data saved!');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should propagate the Equalization tax changes', async () => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitToClick(selectors.clientFiscalData.acceptPropagationButton)
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual('Equivalent tax spreaded');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should confirm its name have been edited', async () => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
||||||
.wait(selectors.clientFiscalData.socialNameInput)
|
.wait(selectors.clientFiscalData.socialNameInput)
|
||||||
|
@ -279,15 +317,15 @@ describe('Client Edit fiscalData path', () => {
|
||||||
|
|
||||||
expect(result).toBeFalsy();
|
expect(result).toBeFalsy();
|
||||||
});
|
});
|
||||||
// Petición #822 creada.
|
|
||||||
// it('should confirm Vies checkbox is checked', async () => {
|
|
||||||
// const result = await nightmare
|
|
||||||
// .evaluate(selector => {
|
|
||||||
// return document.querySelector(selector).checked;
|
|
||||||
// }, selectors.clientFiscalData.viesCheckboxInput);
|
|
||||||
|
|
||||||
// expect(result).toBeTruthy();
|
it('should confirm Vies checkbox is checked', async () => {
|
||||||
// });
|
const result = await nightmare
|
||||||
|
.evaluate(selector => {
|
||||||
|
return document.querySelector(selector).checked;
|
||||||
|
}, selectors.clientFiscalData.viesCheckboxInput);
|
||||||
|
|
||||||
|
expect(result).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
it('should confirm Invoice by mail checkbox is unchecked', async () => {
|
it('should confirm Invoice by mail checkbox is unchecked', async () => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
|
@ -307,13 +345,13 @@ describe('Client Edit fiscalData path', () => {
|
||||||
expect(result).toBeFalsy();
|
expect(result).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm Equalization tax checkbox is checked', async () => {
|
it('should confirm Equalization tax checkbox is unchecked', async () => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.evaluate(selector => {
|
.evaluate(selector => {
|
||||||
return document.querySelector(selector).checked;
|
return document.querySelector(selector).checked;
|
||||||
}, selectors.clientFiscalData.equalizationTaxCheckboxLabel);
|
}, selectors.clientFiscalData.equalizationTaxCheckboxLabel);
|
||||||
|
|
||||||
expect(result).toBeTruthy();
|
expect(result).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm Verified data checkbox is checked', async () => {
|
it('should confirm Verified data checkbox is checked', async () => {
|
||||||
|
@ -341,11 +379,10 @@ describe('Client Edit fiscalData path', () => {
|
||||||
.waitToClick(selectors.clientAddresses.firstEditButton)
|
.waitToClick(selectors.clientAddresses.firstEditButton)
|
||||||
.waitToClick(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
.waitToClick(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
||||||
.click(selectors.clientAddresses.saveButton)
|
.click(selectors.clientAddresses.saveButton)
|
||||||
.waitForLastSnackbar()
|
.waitForLastSnackbar();
|
||||||
.then(result => {
|
|
||||||
expect(result).toEqual('Data saved!');
|
expect(result).toEqual('Data saved!');
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 3
|
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 3
|
||||||
it('should navigate back to fiscal data to confirm invoice by address is now checked', async () => {
|
it('should navigate back to fiscal data to confirm invoice by address is now checked', async () => {
|
||||||
|
|
Loading…
Reference in New Issue