diff --git a/.gitignore b/.gitignore index c78df1df6..81519f667 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ +.DS_Store node_modules build npm-debug.log debug.log datasources.development.json -.idea \ No newline at end of file +.idea diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 97c496bbf..1b772561c 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -53,6 +53,7 @@ export default { invoiceByMailCheckboxLabel: `${components.vnCheck}[label='Invoice by mail'] > label`, invoiceByMailCheckboxInput: `${components.vnCheck}[label='Invoice by mail'] > label > label > input`, addressInput: `${components.vnTextfield}[name="street"]`, + cityInput: `${components.vnTextfield}[name="city"]`, saveButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-auto > vn-vertical > vn-client-fiscal-data > form > vn-button-bar > vn-submit > input' } }; diff --git a/e2e/paths/edit_fiscal_data.spec.js b/e2e/paths/edit_fiscal_data.spec.js index add095d7c..686700b37 100644 --- a/e2e/paths/edit_fiscal_data.spec.js +++ b/e2e/paths/edit_fiscal_data.spec.js @@ -132,4 +132,64 @@ describe('Edit fiscalData path', () => { }) .catch(catchErrors(done)); }); + + it(`should edit the address`, done => { + nightmare + .wait(selectors.fiscalData.addressInput) + .clearInput(selectors.fiscalData.addressInput) + .type(selectors.fiscalData.addressInput, 'Alpha Flight Low-Orbit') + .click(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual(`¡Datos guardados!`); + done(); + }) + .catch(catchErrors(done)); + }); + + it(`should confirm the address have been edited`, done => { + nightmare + .waitForSnackbarReset() + .click(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .click(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.addressInput) + .getInputValue(selectors.fiscalData.addressInput) + .then(result => { + expect(result).toEqual(`Alpha Flight Low-Orbit`); + done(); + }) + .catch(catchErrors(done)); + }); + + it(`should edit the city`, done => { + nightmare + .wait(selectors.fiscalData.cityInput) + .clearInput(selectors.fiscalData.cityInput) + .type(selectors.fiscalData.cityInput, 'N/A') + .click(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual(`¡Datos guardados!`); + done(); + }) + .catch(catchErrors(done)); + }); + + it(`should confirm the acity have been edited`, done => { + nightmare + .waitForSnackbarReset() + .click(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .click(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.cityInput) + .getInputValue(selectors.fiscalData.cityInput) + .then(result => { + expect(result).toEqual(`N/A`); + done(); + }) + .catch(catchErrors(done)); + }); });