test(salix): refs #6321 #6321 fix test
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Javier Segarra 2024-07-20 00:36:59 +02:00
parent 7e8c2eebe5
commit c9c9d5973d
4 changed files with 21 additions and 12 deletions

View File

@ -3953,3 +3953,12 @@ VALUES
(4, 'Referencia Transferencias'),
(5, 'Referencia Nominas'),
(6, 'ABA');
INSERT INTO `vn`.`item` (id,name,`size`,stems,minPrice,isToPrint,family,box,originFk,doPhoto,image,inkFk,intrastatFk,hasMinPrice,created,typeFk,generic,density,relevancy,expenseFk,isActive,longName,subName,tag5,value5,tag6,value6,tag7,value7,minimum,upToDown,hasKgPrice,isFloramondo,isFragile,stemMultiplier,isLaid,lastUsed,editorFk,isBoxPickingMode)
VALUES
(88,'Lack negative',200,1,10.0,0,'VT',0,2,0,'','WHT',6021010,1,'2024-07-19 11:27:32.000',1,0,167,0,'4751000000',1,'Lack negative origin','Stark Industries','Color','White','Categoria','supply','Tallos','1',3,0,0,0,0,1.0,0,'2024-07-19 11:27:32.000',100,0);
INSERT INTO `vn`.`ticket` (id, clientFk,warehouseFk,shipped,nickname,refFk,addressFk,workerFk,observations,isSigned,isLabeled,isPrinted,packages,location,`hour`,created,isBlocked,solution,routeFk,priority,hasPriority,companyFk,agencyModeFk,landed,isBoxed,isDeleted,zoneFk,zonePrice,zoneBonus,totalWithVat,totalWithoutVat,weight,clonedFrom,cmrFk,editorFk,problem,risk) VALUES
(1000000, 1,1,'2001-01-01 00:00:00.000','employee',NULL,131,NULL,NULL,0,0,0,0,NULL,0,'2024-07-19 23:32:48.000',1,NULL,NULL,NULL,1,442,1,'2001-01-01',0,0,1,1.00,0.00,0.00,NULL,NULL,NULL,NULL,9,'',NULL);
INSERT INTO `vn`.`sale` (id, itemFk,ticketFk,concept,quantity,originalQuantity,price,discount,priceFixed,reserved,isPicked,isPriceFixed,created,isAdded,total,editorFk,problem) VALUES
(43, 88,1000000,'Chest medical box 2',155.00,155.0,0.00,0,0.00,0,0,0,'2024-07-19 23:33:08.000',0,0.00,100,'');

View File

@ -21,7 +21,7 @@ describe('route unlink()', () => {
zoneAgencyModes = await models.ZoneAgencyMode.find(null, options);
tickets = await models.Route.getSuggestedTickets(routeId, options);
expect(zoneAgencyModes.length).toEqual(3);
expect(zoneAgencyModes.length).toEqual(4);
expect(tickets.length).toEqual(0);
await tx.rollback();

View File

@ -15,7 +15,7 @@ module.exports = Self => {
http: {source: 'query'}
},
{
arg: 'id',
arg: 'itemFk',
type: 'number',
description: 'The item id',
},
@ -45,7 +45,7 @@ module.exports = Self => {
description: 'origen id',
},
{
arg: 'warehouse',
arg: 'warehouseFk',
type: 'number',
description: 'The warehouse id',
},
@ -79,7 +79,7 @@ module.exports = Self => {
if (typeof options == 'object')
Object.assign(myOptions, options);
const filterKeyOrder = ['days', 'id', 'longname', 'supplier', 'colour', 'size', 'origen', 'lack', 'warehouse'];
const filterKeyOrder = ['days', 'itemFk', 'longname', 'supplier', 'colour', 'size', 'origen', 'lack', 'warehouseFk'];
delete ctx?.args?.ctx;

View File

@ -1,6 +1,6 @@
const models = require('vn-loopback/server/server').models;
describe('Item Lack', () => {
fdescribe('Item Lack', () => {
beforeEach(async() => {
ctx = {
req: {
@ -18,7 +18,7 @@ describe('Item Lack', () => {
try {
const result = await models.Ticket.itemLack(ctx, filter, options);
expect(result.length).toEqual(4);
expect(result.length).toEqual(2);
await tx.rollback();
} catch (e) {
await tx.rollback();
@ -31,7 +31,7 @@ describe('Item Lack', () => {
const options = {transaction: tx};
const filter = {
id: 1
id: 88
};
try {
const result = await models.Ticket.itemLack(ctx, filter, options);
@ -49,7 +49,7 @@ describe('Item Lack', () => {
const options = {transaction: tx};
const filter = {
longname: 'Ranged weapon longbow 200cm'
longname: 'Lack negative'
};
try {
const result = await models.Ticket.itemLack(ctx, filter, options);
@ -85,7 +85,7 @@ describe('Item Lack', () => {
const options = {transaction: tx};
const filter = {
colour: 'BRW'
colour: 'WHT'
};
try {
const result = await models.Ticket.itemLack(ctx, filter, options);
@ -103,12 +103,12 @@ describe('Item Lack', () => {
const options = {transaction: tx};
const filter = {
origen: 2
origen: 1
};
try {
const result = await models.Ticket.itemLack(ctx, filter, options);
expect(result.length).toEqual(3);
expect(result.length).toEqual(2);
await tx.rollback();
} catch (e) {
await tx.rollback();
@ -139,7 +139,7 @@ describe('Item Lack', () => {
const options = {transaction: tx};
const filter = {
lack: '-100'
lack: '-155'
};
try {
const result = await models.Ticket.itemLack(ctx, filter, options);