From 82fd9505ea0da0a18d85ca2d69bf6b4513dc4505 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Fri, 4 Oct 2019 13:13:14 +0200 Subject: [PATCH] =?UTF-8?q?#1587=20e2e=20client.create=20A=C3=B1adir=20c?= =?UTF-8?q?=C3=B3digo=20postal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../02-client-module/01_create_client.spec.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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 b67a89e68f..f2fe304646 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();