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