From 3faf03cf9fed008f5e99f4e4b8c438e2ca251b1e Mon Sep 17 00:00:00 2001 From: Bernat Date: Fri, 11 Jan 2019 15:06:18 +0100 Subject: [PATCH] fix test and update fixtures --- .../ticket-module/08_list_components.spec.js | 6 +++--- .../methods/ticket/specs/componentUpdate.spec.js | 6 +++--- services/db/install/changes/1.2-CHECK/10-ACL.sql | 16 ++++------------ services/db/install/dump/fixtures.sql | 2 +- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/e2e/paths/ticket-module/08_list_components.spec.js b/e2e/paths/ticket-module/08_list_components.spec.js index ec043da97..643b45da7 100644 --- a/e2e/paths/ticket-module/08_list_components.spec.js +++ b/e2e/paths/ticket-module/08_list_components.spec.js @@ -11,7 +11,7 @@ describe('Ticket List components path', () => { .accessToSection('ticket.card.components'); }); - it('should confirm the total base is correct', async () => { + it('should confirm the total base is correct', async() => { const name = 'Base €'; const minLength = name.length; @@ -24,7 +24,7 @@ describe('Ticket List components path', () => { expect(base.length).toBeGreaterThan(minLength); }); - it('should confirm the total margin is correct', async () => { + it('should confirm the total margin is correct', async() => { const name = 'Margin €'; const minLength = name.length; @@ -37,7 +37,7 @@ describe('Ticket List components path', () => { expect(margin.length).toBeGreaterThan(minLength); }); - it('should confirm the total total is correct', async () => { + it('should confirm the total total is correct', async() => { const name = 'Total €'; const minLength = name.length; diff --git a/modules/ticket/back/methods/ticket/specs/componentUpdate.spec.js b/modules/ticket/back/methods/ticket/specs/componentUpdate.spec.js index 6ff7349d9..242d2c123 100644 --- a/modules/ticket/back/methods/ticket/specs/componentUpdate.spec.js +++ b/modules/ticket/back/methods/ticket/specs/componentUpdate.spec.js @@ -11,7 +11,7 @@ describe('ticket componentUpdate()', () => { const today = new Date(); let ticketId = 11; - beforeAll(async () => { + beforeAll(async() => { [componentValue] = await app.models.SaleComponent.rawSql(componentOfSaleSeven); firstvalueBeforeChange = componentValue.value; @@ -19,7 +19,7 @@ describe('ticket componentUpdate()', () => { secondvalueBeforeChange = componentValue.value; }); - it('should change the agencyMode to modify the sale components value', async () => { + it('should change the agencyMode to modify the sale components value', async() => { let data = { clientFk: 101, agencyModeFk: 8, @@ -46,7 +46,7 @@ describe('ticket componentUpdate()', () => { expect(secondvalueBeforeChange).not.toEqual(secondvalueAfterChange); }); - it('should change the agencyMode to go back to the originals sale components value', async () => { + it('should change the agencyMode to go back to the originals sale components value', async() => { let data = { clientFk: 101, agencyModeFk: 7, diff --git a/services/db/install/changes/1.2-CHECK/10-ACL.sql b/services/db/install/changes/1.2-CHECK/10-ACL.sql index 07bf21ab8..3566827b0 100644 --- a/services/db/install/changes/1.2-CHECK/10-ACL.sql +++ b/services/db/install/changes/1.2-CHECK/10-ACL.sql @@ -1,15 +1,4 @@ -/* INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (118, 'WorkerTeam', '*', '*', 'ALLOW', 'role', 'salesPerson'); -INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (119, 'Travel', '*', 'READ', 'ALLOW', 'role', 'employee'); -INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (120, 'Travel', '*', 'WRITE', 'ALLOW', 'role', 'buyer'); -INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (121, 'Item', 'regularize', '*', 'ALLOW', 'role', 'employee'); -INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (122, 'TicketRequest', '*', '*', 'ALLOW', 'role', 'employee'); -INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES('TicketRequest', '*', '*', 'salesPerson'); -UPDATE `salix`.`ACL` SET model='TicketRequest', property='*', accessType='*', permission='ALLOW', principalType='ROLE', principalId='salesPerson' WHERE id=122; -INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`,`role`) VALUES ('ClaimBeginning','*','*','salesAssistant'); -INSERT INTO `salix`.`ACL`(`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Agency', 'getAgenciesWithWarehouse', '*', 'ALLOW', 'ROLE', 'employee'); -INSERT INTO `salix`.`ACL`(`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES('Client', 'activeWorkersWithRole', '*', 'ALLOW', 'ROLE', 'employee'); - */ INSERT INTO `salix`.`ACL`(`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES('CreditClassification', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); INSERT INTO `salix`.`ACL`(`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES('ClientObservation', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); @@ -29,4 +18,7 @@ DELETE FROM `salix`.`ACL` WHERE `id`='67'; DELETE FROM `salix`.`ACL` WHERE `id`='74'; DELETE FROM `salix`.`ACL` WHERE `id`='92'; DELETE FROM `salix`.`ACL` WHERE `id`='93'; -DELETE FROM `salix`.`ACL` WHERE `id`='95'; \ No newline at end of file +DELETE FROM `salix`.`ACL` WHERE `id`='95'; + +INSERT INTO `salix`.`ACL`(`id`,`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) VALUES (133,'TicketLog', '*','READ', 'ALLOW','ROLE','employee'); +INSERT INTO `salix`.`ACL`(`id`,`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) VALUES (134,'TicketService', '*','*', 'ALLOW','ROLE','employee'); diff --git a/services/db/install/dump/fixtures.sql b/services/db/install/dump/fixtures.sql index 79fe5e8fd..7a0a2685c 100644 --- a/services/db/install/dump/fixtures.sql +++ b/services/db/install/dump/fixtures.sql @@ -581,7 +581,7 @@ INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`) (7, 28, 5.6), (7, 29, -4.6), (7, 39, 0.01), - (8, 15, 0.254), + (8, 15, 0.044), (8, 21, -0.004), (8, 28, 20.72), (8, 29, -19.72),