refactor: refs #6583 use warehouseId var
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2024-12-17 13:33:29 +01:00
parent 9ac8e60f0c
commit 31952725aa
1 changed files with 9 additions and 8 deletions

View File

@ -8,6 +8,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
tomorrow.setDate(today.getDate() + 1); tomorrow.setDate(today.getDate() + 1);
const salesDeptId = 43; const salesDeptId = 43;
const spain1DeptId = 95; const spain1DeptId = 95;
const warehouseId = 1;
beforeAll.mockLoopBackContext(); beforeAll.mockLoopBackContext();
it('should return the tickets passing the required data', async() => { it('should return the tickets passing the required data', async() => {
@ -19,7 +20,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
const args = { const args = {
dateFuture: tomorrow, dateFuture: tomorrow,
dateToAdvance: today, dateToAdvance: today,
warehouseFk: 1, warehouseFk: warehouseId,
}; };
ctx.args = args; ctx.args = args;
@ -42,7 +43,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
const args = { const args = {
dateFuture: tomorrow, dateFuture: tomorrow,
dateToAdvance: today, dateToAdvance: today,
warehouseFk: 1, warehouseFk: warehouseId,
isFullMovable: true isFullMovable: true
}; };
@ -67,7 +68,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
const args = { const args = {
dateFuture: tomorrow, dateFuture: tomorrow,
dateToAdvance: today, dateToAdvance: today,
warehouseFk: 1, warehouseFk: warehouseId,
isFullMovable: false isFullMovable: false
}; };
@ -92,7 +93,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
const args = { const args = {
dateFuture: tomorrow, dateFuture: tomorrow,
dateToAdvance: today, dateToAdvance: today,
warehouseFk: 1, warehouseFk: warehouseId,
ipt: 'V' ipt: 'V'
}; };
@ -117,7 +118,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
const args = { const args = {
dateFuture: tomorrow, dateFuture: tomorrow,
dateToAdvance: today, dateToAdvance: today,
warehouseFk: 1, warehouseFk: warehouseId,
tfIpt: 'V' tfIpt: 'V'
}; };
@ -141,7 +142,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
ctx.args = { ctx.args = {
dateFuture: tomorrow, dateFuture: tomorrow,
dateToAdvance: today, dateToAdvance: today,
warehouseFk: 1, warehouseFk: warehouseId,
}; };
await models.Ticket.updateAll({id: {inq: [12, 31]}}, {clientFk: 1}, options); await models.Ticket.updateAll({id: {inq: [12, 31]}}, {clientFk: 1}, options);
@ -177,7 +178,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
const args = { const args = {
dateFuture: today, dateFuture: today,
dateToAdvance: today.setHours(23, 59, 59, 999), dateToAdvance: today.setHours(23, 59, 59, 999),
warehouseFk: 1, warehouseFk: warehouseId,
}; };
ctx.args = args; ctx.args = args;
@ -203,7 +204,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
const args = { const args = {
dateFuture: today, dateFuture: today,
dateToAdvance: today.setHours(23, 59, 59, 999), dateToAdvance: today.setHours(23, 59, 59, 999),
warehouseFk: 1, warehouseFk: warehouseId,
}; };
ctx.args = args; ctx.args = args;