2018-02-15 11:28:05 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2018-02-20 09:00:19 +00:00
|
|
|
import createNightmare from '../../helpers/helpers';
|
2017-12-13 10:25:50 +00:00
|
|
|
|
2018-09-05 06:27:50 +00:00
|
|
|
describe('Client Edit fiscalData path', () => {
|
|
|
|
const nightmare = createNightmare();
|
2018-10-16 13:35:52 +00:00
|
|
|
describe('as employee', () => {
|
|
|
|
beforeAll(() => {
|
|
|
|
return nightmare
|
|
|
|
.waitForLogin('employee');
|
|
|
|
});
|
2017-12-07 14:40:16 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should click on the Clients button of the top bar menu', () => {
|
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.clientsButton)
|
|
|
|
.wait(selectors.clientsIndex.createClientButton)
|
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
|
|
|
expect(url.hash).toEqual('#!/client/index');
|
|
|
|
});
|
2018-04-05 06:55:47 +00:00
|
|
|
});
|
2018-03-02 11:15:17 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should search for the user Bruce Banner', () => {
|
|
|
|
return nightmare
|
|
|
|
.wait(selectors.clientsIndex.searchResult)
|
|
|
|
.type(selectors.clientsIndex.searchClientInput, 'Bruce Banner')
|
|
|
|
.click(selectors.clientsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
|
|
|
|
.countElement(selectors.clientsIndex.searchResult)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(1);
|
|
|
|
});
|
2018-09-05 06:27:50 +00:00
|
|
|
});
|
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
// Confirms all addresses have EQtax false for future propagation test step 1
|
2018-09-05 06:27:50 +00:00
|
|
|
it(`should click on the search result to access to the client's addresses`, () => {
|
2018-04-05 06:55:47 +00:00
|
|
|
return nightmare
|
2018-09-05 06:27:50 +00:00
|
|
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
|
|
|
.waitToClick(selectors.clientsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
|
|
|
.waitForURL('/address/index')
|
|
|
|
.url()
|
2018-04-05 06:55:47 +00:00
|
|
|
.then(url => {
|
2018-09-05 06:27:50 +00:00
|
|
|
expect(url).toContain('/address/index');
|
2018-04-05 06:55:47 +00:00
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
// Confirms all addresses have EQtax false for future propagation test step 2
|
2018-09-05 06:27:50 +00:00
|
|
|
it(`should click on the 1st edit icon to check EQtax isnt checked`, () => {
|
2018-04-05 06:55:47 +00:00
|
|
|
return nightmare
|
2018-09-05 06:27:50 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.firstEditButton)
|
|
|
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
2018-04-05 06:55:47 +00:00
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
// Confirms all addresses have EQtax false for future propagation test step 3
|
2018-09-05 06:27:50 +00:00
|
|
|
it(`should go back to addresses then select the second one and confirm the EQtax isnt checked`, () => {
|
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
|
|
|
.waitToClick(selectors.clientAddresses.secondEditButton)
|
|
|
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
2018-04-05 06:55:47 +00:00
|
|
|
});
|
2018-09-05 06:27:50 +00:00
|
|
|
});
|
2018-04-05 06:55:47 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it(`should click on the fiscal data button to start editing`, () => {
|
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.waitForURL('fiscal-data')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('fiscal-data');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the social name', () => {
|
|
|
|
return nightmare
|
|
|
|
.wait(selectors.clientFiscalData.socialNameInput)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.socialNameInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
2018-09-05 06:27:50 +00:00
|
|
|
});
|
2018-04-05 06:55:47 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should not be able to edit the fiscal id', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.fiscalIdInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the address', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.addressInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the postcode', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.postcodeInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the city', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.cityInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the country', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.countryInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the province', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.provinceInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the active checkbox', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.activeCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the frozen checkbox', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.frozenCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the has to invoice checkbox', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.hasToInvoiceCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
2018-04-05 06:55:47 +00:00
|
|
|
});
|
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should not be able to edit the vies checkbox', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.viesCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the invoice by mail checkbox', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.invoiceByMailCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the invoice by address', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the equalization tax checkbox', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to edit the verified data checkbox', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.verifiedDataCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to use the submit button', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).disabled;
|
|
|
|
}, selectors.clientFiscalData.saveButton)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
2018-09-05 06:27:50 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
describe('as administrative', () => {
|
|
|
|
beforeAll(() => {
|
|
|
|
return nightmare
|
|
|
|
.waitForLogin('administrative');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should now click on the Clients button of the top bar menu', () => {
|
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.clientsButton)
|
|
|
|
.wait(selectors.clientsIndex.createClientButton)
|
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
|
|
|
expect(url.hash).toEqual('#!/client/index');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should now search for the user Bruce Banner', () => {
|
|
|
|
return nightmare
|
|
|
|
.wait(selectors.clientsIndex.searchResult)
|
|
|
|
.type(selectors.clientsIndex.searchClientInput, 'Bruce Banner')
|
|
|
|
.click(selectors.clientsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
|
|
|
|
.countElement(selectors.clientsIndex.searchResult)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(1);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should access to the client fiscal data`, () => {
|
|
|
|
return nightmare
|
|
|
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
|
|
|
.waitToClick(selectors.clientsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.waitForURL('fiscal-data')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('fiscal-data');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should edit the clients fiscal data', () => {
|
|
|
|
return nightmare
|
|
|
|
.wait(selectors.clientFiscalData.socialNameInput)
|
|
|
|
.clearInput(selectors.clientFiscalData.socialNameInput)
|
|
|
|
.type(selectors.clientFiscalData.socialNameInput, 'SMASH!')
|
|
|
|
.waitForTextInInput(selectors.clientFiscalData.socialNameInput, 'SMASH!')
|
|
|
|
.clearInput(selectors.clientFiscalData.fiscalIdInput)
|
|
|
|
.type(selectors.clientFiscalData.fiscalIdInput, '94980061C')
|
|
|
|
.clearInput(selectors.clientFiscalData.addressInput)
|
|
|
|
.type(selectors.clientFiscalData.addressInput, 'Somewhere edited')
|
|
|
|
.clearInput(selectors.clientFiscalData.postcodeInput)
|
|
|
|
.type(selectors.clientFiscalData.postcodeInput, '12345')
|
|
|
|
.clearInput(selectors.clientFiscalData.cityInput)
|
|
|
|
.type(selectors.clientFiscalData.cityInput, 'N/A')
|
|
|
|
.waitToClick(selectors.clientFiscalData.countryInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.countryThirdOption)
|
|
|
|
.waitToClick(selectors.clientFiscalData.provinceInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.provinceFifthOption)
|
|
|
|
.waitToClick(selectors.clientFiscalData.activeCheckboxLabel)
|
|
|
|
.waitToClick(selectors.clientFiscalData.frozenCheckboxLabel)
|
|
|
|
.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckboxLabel)
|
|
|
|
.waitToClick(selectors.clientFiscalData.viesCheckboxInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.invoiceByMailCheckboxLabel)
|
|
|
|
.waitToClick(selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
|
|
|
.waitToClick(selectors.clientFiscalData.verifiedDataCheckboxInput)
|
|
|
|
.click(selectors.clientFiscalData.saveButton)
|
|
|
|
.waitForLastSnackbar()
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should propagate the Equalization tax', () => {
|
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.clientFiscalData.acceptPropagationButton)
|
|
|
|
.waitForLastSnackbar()
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Equivalent tax spreaded');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// confirm all addresses have now EQtax checked step 1
|
2018-09-05 06:27:50 +00:00
|
|
|
it(`should click on the addresses button to access to the client's addresses`, () => {
|
2018-02-20 09:00:19 +00:00
|
|
|
return nightmare
|
2018-09-05 06:27:50 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
|
|
|
.waitForURL('/address/index')
|
2017-12-14 13:56:20 +00:00
|
|
|
.url()
|
|
|
|
.then(url => {
|
2018-09-05 06:27:50 +00:00
|
|
|
expect(url).toContain('/address/index');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
// confirm all addresses have now EQtax checked step 2
|
2018-09-05 06:27:50 +00:00
|
|
|
it(`should click on the 1st edit icon to confirm EQtax is checked`, () => {
|
2018-02-20 09:00:19 +00:00
|
|
|
return nightmare
|
2018-09-05 06:27:50 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.firstEditButton)
|
|
|
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
// confirm all addresses have now EQtax checked step 3
|
2018-09-05 06:27:50 +00:00
|
|
|
it(`should go back to addresses then select the second one and confirm the EQtax is checked`, () => {
|
2018-02-20 09:00:19 +00:00
|
|
|
return nightmare
|
2018-09-05 06:27:50 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
|
|
|
.waitToClick(selectors.clientAddresses.secondEditButton)
|
|
|
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should navigate back to fiscal data to confirm its name have been edited', () => {
|
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.socialNameInput)
|
|
|
|
.getInputValue(selectors.clientFiscalData.socialNameInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('SMASH!');
|
|
|
|
});
|
2018-09-05 06:27:50 +00:00
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm the fiscal id have been edited', () => {
|
|
|
|
return nightmare
|
|
|
|
.getInputValue(selectors.clientFiscalData.fiscalIdInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('94980061C');
|
|
|
|
});
|
2018-09-05 06:27:50 +00:00
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm the address have been edited', () => {
|
|
|
|
return nightmare
|
|
|
|
.getInputValue(selectors.clientFiscalData.addressInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Somewhere edited');
|
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-08 14:43:34 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm the postcode have been edited', () => {
|
|
|
|
return nightmare
|
|
|
|
.getInputValue(selectors.clientFiscalData.postcodeInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('12345');
|
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm the city have been edited', () => {
|
|
|
|
return nightmare
|
|
|
|
.getInputValue(selectors.clientFiscalData.cityInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('N/A');
|
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it(`should confirm the country have been selected`, () => {
|
|
|
|
return nightmare
|
|
|
|
.getInputValue(selectors.clientFiscalData.countryInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Francia');
|
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it(`should confirm the province have been selected`, () => {
|
|
|
|
return nightmare
|
|
|
|
.getInputValue(selectors.clientFiscalData.provinceInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Province two');
|
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 12:54:06 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm active checkbox is unchecked', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientFiscalData.activeCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 12:54:06 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm frozen checkbox is unchecked', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientFiscalData.frozenCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 12:54:06 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm Has to invoice checkbox is unchecked', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientFiscalData.hasToInvoiceCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 13:47:09 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm Vies checkbox is checked', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientFiscalData.viesCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm Invoice by mail checkbox is unchecked', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientFiscalData.invoiceByMailCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
|
|
|
});
|
2018-03-20 07:28:30 +00:00
|
|
|
});
|
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm invoice by address checkbox is unchecked', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm Equalization tax checkbox is checked', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
it('should confirm Verified data checkbox is checked', () => {
|
|
|
|
return nightmare
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.clientFiscalData.verifiedDataCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 1
|
2018-09-05 06:27:50 +00:00
|
|
|
it(`should click on the addresses button to access to the client's addresses`, () => {
|
2018-04-05 06:55:47 +00:00
|
|
|
return nightmare
|
2018-09-05 06:27:50 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
|
|
|
.waitForURL('/address/index')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/address/index');
|
2018-04-05 06:55:47 +00:00
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 2
|
2018-09-05 06:27:50 +00:00
|
|
|
it(`should click on the 1st edit icon to access the address details and uncheck EQtax checkbox`, () => {
|
2018-04-05 06:55:47 +00:00
|
|
|
return nightmare
|
2018-09-05 06:27:50 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.firstEditButton)
|
|
|
|
.waitToClick(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
|
|
|
.click(selectors.clientAddresses.saveButton)
|
2018-09-17 08:50:15 +00:00
|
|
|
.waitForLastSnackbar()
|
2018-09-05 06:27:50 +00:00
|
|
|
.then(result => {
|
2018-09-17 08:50:15 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2018-08-08 12:04:13 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-10-16 13:35:52 +00:00
|
|
|
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 3
|
2018-09-05 06:27:50 +00:00
|
|
|
it('should navigate back to fiscal data to confirm invoice by address is now checked', () => {
|
2018-08-08 12:04:13 +00:00
|
|
|
return nightmare
|
2018-09-05 06:27:50 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
2018-08-08 12:04:13 +00:00
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-09-05 06:27:50 +00:00
|
|
|
}, selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
2018-04-05 06:55:47 +00:00
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
});
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
});
|