salix/modules/monitor/back/methods/sales-monitor/specs/deleteOrders.spec.js

22 lines
585 B
JavaScript

const app = require('vn-loopback/server/server');
describe('SalesMonitor deleteOrders()', () => {
it('should return the deleted orders', async() => {
const tx = await app.models.Order.beginTransaction({});
try {
const options = {transaction: tx};
const deletes = [1, 2];
const result = await app.models.SalesMonitor.deleteOrders(deletes, options);
expect(result.count).toEqual(2);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});