params are now defined for future maintenance
This commit is contained in:
parent
979660dac3
commit
6283f31f5a
|
@ -3,6 +3,19 @@ const app = require(`../../../ticket/server/server`);
|
||||||
describe('ticket ticketCalculateClon()', () => {
|
describe('ticket ticketCalculateClon()', () => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
it('should add the ticket to the order containing the original ticket', async() => {
|
it('should add the ticket to the order containing the original ticket', async() => {
|
||||||
|
let params = {
|
||||||
|
clientFk: 101,
|
||||||
|
shipped: today,
|
||||||
|
warehouseFk: 1,
|
||||||
|
companyFk: 442,
|
||||||
|
addressFk: 121,
|
||||||
|
agencyType: 23,
|
||||||
|
routeFk: 1,
|
||||||
|
landed: today,
|
||||||
|
userId: 21,
|
||||||
|
originalTicketId: 11
|
||||||
|
};
|
||||||
|
|
||||||
let query = `
|
let query = `
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
CALL vn.ticketCreateWithUser(?, ?, ?, ?, ?, ?, ?, ?, ?, @result);
|
CALL vn.ticketCreateWithUser(?, ?, ?, ?, ?, ?, ?, ?, ?, @result);
|
||||||
|
@ -11,16 +24,16 @@ describe('ticket ticketCalculateClon()', () => {
|
||||||
SELECT * FROM tmp.agencyHourGetShipped;
|
SELECT * FROM tmp.agencyHourGetShipped;
|
||||||
ROLLBACK;`;
|
ROLLBACK;`;
|
||||||
let result = await app.models.Ticket.rawSql(query, [
|
let result = await app.models.Ticket.rawSql(query, [
|
||||||
101,
|
params.clientFk,
|
||||||
today,
|
params.shipped,
|
||||||
1,
|
params.warehouseFk,
|
||||||
442,
|
params.companyFk,
|
||||||
121,
|
params.addressFk,
|
||||||
23,
|
params.agencyType,
|
||||||
1,
|
params.routeFk,
|
||||||
today,
|
params.landed,
|
||||||
21,
|
params.userId,
|
||||||
11
|
params.originalTicketId
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let expectedOrder = 11;
|
let expectedOrder = 11;
|
||||||
|
@ -34,6 +47,19 @@ describe('ticket ticketCalculateClon()', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add the ticket to the order containing the original ticket and generate landed value if it was null', async() => {
|
it('should add the ticket to the order containing the original ticket and generate landed value if it was null', async() => {
|
||||||
|
let params = {
|
||||||
|
clientFk: 101,
|
||||||
|
shipped: today,
|
||||||
|
warehouseFk: 1,
|
||||||
|
companyFk: 442,
|
||||||
|
addressFk: 121,
|
||||||
|
agencyType: 23,
|
||||||
|
routeFk: 1,
|
||||||
|
landed: null,
|
||||||
|
userId: 21,
|
||||||
|
originalTicketId: 11
|
||||||
|
};
|
||||||
|
|
||||||
let query = `
|
let query = `
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
CALL vn.ticketCreateWithUser(?, ?, ?, ?, ?, ?, ?, ?, ?, @result);
|
CALL vn.ticketCreateWithUser(?, ?, ?, ?, ?, ?, ?, ?, ?, @result);
|
||||||
|
@ -42,16 +68,16 @@ describe('ticket ticketCalculateClon()', () => {
|
||||||
SELECT * FROM tmp.agencyHourGetShipped;
|
SELECT * FROM tmp.agencyHourGetShipped;
|
||||||
ROLLBACK;`;
|
ROLLBACK;`;
|
||||||
let result = await app.models.Ticket.rawSql(query, [
|
let result = await app.models.Ticket.rawSql(query, [
|
||||||
101,
|
params.clientFk,
|
||||||
today,
|
params.shipped,
|
||||||
1,
|
params.warehouseFk,
|
||||||
442,
|
params.companyFk,
|
||||||
121,
|
params.addressFk,
|
||||||
23,
|
params.agencyType,
|
||||||
1,
|
params.routeFk,
|
||||||
null,
|
params.landed,
|
||||||
21,
|
params.userId,
|
||||||
11
|
params.originalTicketId
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let expectedOrder = 11;
|
let expectedOrder = 11;
|
||||||
|
|
Loading…
Reference in New Issue