diff --git a/db/changes/10081-agency/00-zone.sql b/db/changes/10081-agency/00-zone.sql index 6abab582e9..d01008a320 100644 --- a/db/changes/10081-agency/00-zone.sql +++ b/db/changes/10081-agency/00-zone.sql @@ -1,5 +1,6 @@ +USE `vn`; -CREATE TABLE vn.`zoneWarehouse` ( +CREATE TABLE `vn`.`zoneWarehouse` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `zoneFk` int(11) NOT NULL, `warehouseFk` smallint(6) unsigned NOT NULL, @@ -10,7 +11,7 @@ CREATE TABLE vn.`zoneWarehouse` ( CONSTRAINT `zoneWarehouse_ibfk_2` FOREIGN KEY (`warehouseFk`) REFERENCES `vn2008`.`warehouse` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; -CREATE TABLE vn.`zoneEvent` ( +CREATE TABLE `vn`.`zoneEvent` ( `id` int(11) NOT NULL AUTO_INCREMENT, `zoneFk` int(11) NOT NULL, `from` date DEFAULT NULL, @@ -25,7 +26,7 @@ CREATE TABLE vn.`zoneEvent` ( CONSTRAINT `zoneEvent_ibfk_1` FOREIGN KEY (`zoneFk`) REFERENCES `zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; -CREATE TABLE vn.`zoneExclusion` ( +CREATE TABLE `vn`.`zoneExclusion` ( `id` int(11) NOT NULL AUTO_INCREMENT, `zoneFk` int(11) NOT NULL, `day` date NOT NULL, 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();