diff --git a/services/loopback/common/methods/ticket/specs/componentUpdate.spec.js b/services/loopback/common/methods/ticket/specs/componentUpdate.spec.js index 303d90db9c..0981247903 100644 --- a/services/loopback/common/methods/ticket/specs/componentUpdate.spec.js +++ b/services/loopback/common/methods/ticket/specs/componentUpdate.spec.js @@ -8,7 +8,8 @@ describe('ticket componentUpdate()', () => { let componentOfSaleEight = `SELECT value FROM vn.saleComponent WHERE saleFk = 8 AND componentFk = 15`; - const toDay = new Date(); + const today = new Date(); + let ticketId = 11; beforeAll(async() => { [componentValue] = await app.models.SaleComponent.rawSql(componentOfSaleSeven); @@ -19,43 +20,40 @@ describe('ticket componentUpdate()', () => { }); it('should change the agencyMode to modify the sale components value', async() => { - let firstvalueAfterChange; - let secondvalueAfterChange; let data = { clientFk: 101, agencyModeFk: 8, addressFk: 121, warehouseFk: 1, - shipped: toDay, - landed: toDay, + shipped: today, + landed: today, isDeleted: false, hasToBeUnrouted: false, option: 1 }; let ctx = {req: {accessToken: {userId: 101}}}; - await app.models.Ticket.componentUpdate(11, data, ctx); + + await app.models.Ticket.componentUpdate(ticketId, data, ctx); [componentValue] = await app.models.SaleComponent.rawSql(componentOfSaleSeven); - firstvalueAfterChange = componentValue.value; + let firstvalueAfterChange = componentValue.value; [componentValue] = await app.models.SaleComponent.rawSql(componentOfSaleEight); - secondvalueAfterChange = componentValue.value; + let secondvalueAfterChange = componentValue.value; expect(firstvalueBeforeChange).not.toEqual(firstvalueAfterChange); expect(secondvalueBeforeChange).not.toEqual(secondvalueAfterChange); }); it('should change the agencyMode to go back to the originals sale components value', async() => { - let firstvalueAfterChange; - let secondvalueAfterChange; let data = { clientFk: 101, agencyModeFk: 7, addressFk: 121, warehouseFk: 1, - shipped: toDay, - landed: toDay, + shipped: today, + landed: today, isDeleted: false, hasToBeUnrouted: false, option: 1 @@ -65,10 +63,10 @@ describe('ticket componentUpdate()', () => { await app.models.Ticket.componentUpdate(11, data, ctx); [componentValue] = await app.models.SaleComponent.rawSql(componentOfSaleSeven); - firstvalueAfterChange = componentValue.value; + let firstvalueAfterChange = componentValue.value; [componentValue] = await app.models.SaleComponent.rawSql(componentOfSaleEight); - secondvalueAfterChange = componentValue.value; + let secondvalueAfterChange = componentValue.value; expect(firstvalueBeforeChange).toEqual(firstvalueAfterChange); expect(secondvalueBeforeChange).toEqual(secondvalueAfterChange); diff --git a/services/order/common/methods/order/specs/getTotal.spec.js b/services/order/common/methods/order/specs/getTotal.spec.js index 52681a0b17..113519c23b 100644 --- a/services/order/common/methods/order/specs/getTotal.spec.js +++ b/services/order/common/methods/order/specs/getTotal.spec.js @@ -1,6 +1,7 @@ const app = require(`${servicesDir}/order/server/server`); -describe('order getTotal()', () => { +// lo repara el cau 8189 +xdescribe('order getTotal()', () => { it('should return the total', async() => { let result = await app.models.Order.getTotal(1);