This commit is contained in:
parent
9e8efff016
commit
3ecfbe2052
|
@ -3,6 +3,7 @@ const LoopBackContext = require('loopback-context');
|
||||||
|
|
||||||
describe('InvoiceOut refund()', () => {
|
describe('InvoiceOut refund()', () => {
|
||||||
const userId = 5;
|
const userId = 5;
|
||||||
|
const withWarehouse = true;
|
||||||
const activeCtx = {
|
const activeCtx = {
|
||||||
accessToken: {userId: userId},
|
accessToken: {userId: userId},
|
||||||
};
|
};
|
||||||
|
@ -15,7 +16,7 @@ describe('InvoiceOut refund()', () => {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await models.InvoiceOut.refund('T1111111', true, options);
|
const result = await models.InvoiceOut.refund('T1111111', withWarehouse, options);
|
||||||
|
|
||||||
expect(result).toBeDefined();
|
expect(result).toBeDefined();
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ describe('Sale refund()', () => {
|
||||||
const activeCtx = {
|
const activeCtx = {
|
||||||
accessToken: {userId: userId},
|
accessToken: {userId: userId},
|
||||||
};
|
};
|
||||||
|
|
||||||
const servicesIds = [3];
|
const servicesIds = [3];
|
||||||
|
const withWarehouse = true;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||||
|
@ -22,7 +22,7 @@ describe('Sale refund()', () => {
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
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();
|
expect(refundedTicket).toBeDefined();
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ describe('Sale refund()', () => {
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
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({
|
const refundedTicket = await models.Ticket.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
Loading…
Reference in New Issue