diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 48c65e632..e2d9c4f4b 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -433,7 +433,7 @@ INSERT INTO `vn`.`invoiceOutSerial` (`code`, `description`, `isTaxed`, `taxAreaF ('T', 'EspaƱola rapida', 1, 'NATIONAL', 0), ('V', 'Intracomunitaria global', 0, 'CEE', 1); -INSERT INTO `vn`.`zone` (`id`, `name`, `hour`, `warehouseFk`, `agencyModeFk`, `travelingDays`, `price`, `bonus`) +INSERT INTO `vn`.`zone` (`id`, `name`, `hour`, `warehouseFk`, `agencyModeFk`, `travelingDays`, `price`, `bonus`) VALUES (1, 'Zone pickup A', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 1, 1, 0, 0, 0), (2, 'Zone pickup B', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 2, 1, 0, 0, 0), @@ -441,8 +441,8 @@ INSERT INTO `vn`.`zone` (`id`, `name`, `hour`, `warehouseFk`, `agencyModeFk`, `t (4, 'Zone 247 B', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 2, 7, 1, 2, 0), (5, 'Zone expensive A', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 1, 8, 1, 1000, 0), (6, 'Zone expensive B', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 2, 8, 1, 1000, 0), - (7, 'Zone refund', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 1, 10, 0, 0, 0), - (8, 'Zone others', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 1, 23, 0, 0, 0), + (7, 'Zone refund', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 1, 23, 0, 0, 0), + (8, 'Zone others', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 1, 10, 0, 0, 0), (9, 'Zone superMan', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 1, 2, 0, 0, 0), (10, 'Zone teleportation', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 3, 3, 0, 0, 0), (11, 'Zone pickup C', CONCAT(CURRENT_DATE(), ' ', TIME('22:00')), 5, 1, 0, 0, 0), @@ -473,8 +473,8 @@ INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeF (20, 1, 5, 5, 3, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 109, 'Somewhere in Thailand', 129, NULL, 0, 13, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), (21, NULL, 5, 5, NULL, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 109, 'Somewhere in Holland', 102, NULL, 0, 13, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), (22, NULL, 5, 5, NULL, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 109, 'Somewhere in Japan', 103, NULL, 0, 13, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), - (23, NULL, 23, 1, NULL, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 101, 'address 21', 121, NULL, 0, 8, CURDATE()), - (24 ,NULL, 23, 1, NULL, CURDATE(), CURDATE(), 101, 'Bruce Wayne', 1, NULL, 0, 8, CURDATE()); + (23, NULL, 10, 1, NULL, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 101, 'address 21', 121, NULL, 0, 8, CURDATE()), + (24 ,NULL, 10, 1, NULL, CURDATE(), CURDATE(), 101, 'Bruce Wayne', 1, NULL, 0, 8, CURDATE()); INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`) VALUES diff --git a/e2e/paths/04-item-module/09_regularize.spec.js b/e2e/paths/04-item-module/09_regularize.spec.js index 0208a0eb5..1a9159655 100644 --- a/e2e/paths/04-item-module/09_regularize.spec.js +++ b/e2e/paths/04-item-module/09_regularize.spec.js @@ -11,6 +11,7 @@ describe('Item regularize path', () => { it('should edit the user local warehouse', async() => { let result = await nightmare + .waitForSpinnerLoad() .waitToClick(selectors.globalItems.userMenuButton) .autocompleteSearch(selectors.globalItems.userLocalWarehouse, 'Warehouse Four') .waitForLastSnackbar(); diff --git a/e2e/paths/05-ticket-module/06_basic_data_steps.spec.js b/e2e/paths/05-ticket-module/06_basic_data_steps.spec.js index 72e194600..27af89302 100644 --- a/e2e/paths/05-ticket-module/06_basic_data_steps.spec.js +++ b/e2e/paths/05-ticket-module/06_basic_data_steps.spec.js @@ -11,10 +11,58 @@ describe('Ticket Edit basic data path', () => { .accessToSection('ticket.card.basicData.stepOne'); }); - it(`should edit the ticket agency then click next`, async() => { + it(`should confirm the zone autocomplete is disabled unless your role is productionBoss`, async() => { + const disabled = await nightmare + .wait(selectors.ticketBasicData.zoneAutocomplete) + .evaluate(selector => { + return document.querySelector(selector).disabled; + }, `${selectors.ticketBasicData.zoneAutocomplete} input`); + + expect(disabled).toBeTruthy(); + }); + + it(`should now log as productionBoss to perform the rest of the tests`, async() => { + await nightmare + .loginAndModule('productionBoss', 'ticket') + .accessToSearchResult(11) + .accessToSection('ticket.card.basicData.stepOne'); + }); + + it(`should confirm the zone autocomplete is enabled for the role productionBoss`, async() => { + const disabled = await nightmare + .wait(selectors.ticketBasicData.zoneAutocomplete) + .evaluate(selector => { + return document.querySelector(selector).disabled; + }, `${selectors.ticketBasicData.zoneAutocomplete} input`); + + expect(disabled).toBeFalsy(); + }); + + it(`should check the zone is for Silla247`, async() => { + let zone = await nightmare + .waitToGetProperty(`${selectors.ticketBasicData.zoneAutocomplete} input`, 'value'); + + expect(zone).toContain('Zone 247 A'); + }); + + it(`should edit the ticket agency then check there are no zones for it`, async() => { + let zone = await nightmare + .autocompleteSearch(selectors.ticketBasicData.agencyAutocomplete, 'Entanglement') + .getProperty(`${selectors.ticketBasicData.zoneAutocomplete} input`, 'value'); + + expect(zone.length).toEqual(0); + }); + + it(`should edit the ticket zone then check the agency is for the new zone`, async() => { + let zone = await nightmare + .autocompleteSearch(selectors.ticketBasicData.zoneAutocomplete, 'Zone expensive A') + .waitToGetProperty(`${selectors.ticketBasicData.agencyAutocomplete} input`, 'value'); + + expect(zone).toContain('Silla247Expensive'); + }); + + it(`should click next`, async() => { let url = await nightmare - .autocompleteSearch(selectors.ticketBasicData.agencyAutocomplete, 'Silla247Expensive') - .waitToGetProperty(`${selectors.ticketBasicData.zoneAutocomplete} input`, 'value') .waitToClick(selectors.ticketBasicData.nextStepButton) .waitForURL('data/step-two') .parsedUrl(); diff --git a/modules/ticket/front/basic-data/step-one/index.html b/modules/ticket/front/basic-data/step-one/index.html index d3f2807b9..512e1f110 100644 --- a/modules/ticket/front/basic-data/step-one/index.html +++ b/modules/ticket/front/basic-data/step-one/index.html @@ -5,7 +5,6 @@ order="name" auto-load="true"> -