This commit is contained in:
parent
9e8efff016
commit
3ecfbe2052
|
@ -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();
|
||||
|
||||
|
|
|
@ -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: {
|
||||
|
|
Loading…
Reference in New Issue