diff --git a/e2e/paths/02-client-module/01_create_client.spec.js b/e2e/paths/02-client-module/01_create_client.spec.js index b67a89e68..f2fe30464 100644 --- a/e2e/paths/02-client-module/01_create_client.spec.js +++ b/e2e/paths/02-client-module/01_create_client.spec.js @@ -65,6 +65,18 @@ describe('Client create path', () => { expect(result).toEqual('Some fields are invalid'); }); + it(`should attempt to create a new user with all it's data but wrong postal code`, async() => { + const result = await nightmare + .clearInput(selectors.createClientView.email) + .write(selectors.createClientView.email, 'CarolDanvers@verdnatura.es') + .clearInput(selectors.createClientView.postcode) + .write(selectors.createClientView.postcode, '479999') + .waitToClick(selectors.createClientView.createButton) + .waitForLastSnackbar(); + + expect(result).toEqual(`The postcode doesn't exists. Ensure you put the correct format`); + }); + it(`should check for autocompleted city, province and country`, async() => { const clientCity = await nightmare .waitToGetProperty(`${selectors.createClientView.city}`, 'value'); @@ -82,8 +94,8 @@ describe('Client create path', () => { it(`should create a new user with all correct data`, async() => { const result = await nightmare - .clearInput(selectors.createClientView.email) - .write(selectors.createClientView.email, 'caroldanvers@verdnatura.es') + .clearInput(selectors.createClientView.postcode) + .write(selectors.createClientView.postcode, '46000') .waitToClick(selectors.createClientView.createButton) .waitForLastSnackbar();