refs #5252 refactor: creadas varaibles
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-05-26 12:03:36 +02:00
parent 9e8efff016
commit 3ecfbe2052
2 changed files with 5 additions and 4 deletions

View File

@ -3,6 +3,7 @@ const LoopBackContext = require('loopback-context');
describe('InvoiceOut refund()', () => {
const userId = 5;
const withWarehouse = true;
const activeCtx = {
accessToken: {userId: userId},
};
@ -15,7 +16,7 @@ describe('InvoiceOut refund()', () => {
const options = {transaction: tx};
try {
const result = await models.InvoiceOut.refund('T1111111', true, options);
const result = await models.InvoiceOut.refund('T1111111', withWarehouse, options);
expect(result).toBeDefined();

View File

@ -6,8 +6,8 @@ describe('Sale refund()', () => {
const activeCtx = {
accessToken: {userId: userId},
};
const servicesIds = [3];
const withWarehouse = true;
beforeEach(() => {
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
@ -22,7 +22,7 @@ describe('Sale refund()', () => {
try {
const options = {transaction: tx};
const refundedTicket = await models.Sale.refund(salesIds, servicesIds, true, options);
const refundedTicket = await models.Sale.refund(salesIds, servicesIds, withWarehouse, options);
expect(refundedTicket).toBeDefined();
@ -40,7 +40,7 @@ describe('Sale refund()', () => {
try {
const options = {transaction: tx};
const ticket = await models.Sale.refund(salesIds, servicesIds, true, options);
const ticket = await models.Sale.refund(salesIds, servicesIds, withWarehouse, options);
const refundedTicket = await models.Ticket.findOne({
where: {