salix/modules/ticket/back/methods/boxing/specs/getVideoList.js

36 lines
922 B
JavaScript
Raw Normal View History

2022-09-07 11:58:39 +00:00
const models = require('vn-loopback/server/server').models;
const axios = require('axios');
describe('boxing getVideoList()', () => {
it('should return data', async() => {
const tx = await models.PackingSiteConfig.beginTransaction({});
try {
const options = {transaction: tx};
const params = {
id: 1,
from: 1,
to: 2
};
const response = {
data: {
pipe: () => {},
on: () => {},
}
};
spyOn(axios, 'get').and.returnValue(new Promise(resolve => resolve(response)));
const result = await models.Sale.canEdit(params, options);
expect(result).toEqual([]);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});