salix/modules/ticket/back/methods/expedition/specs/deleteExpeditions.spec.js

23 lines
615 B
JavaScript
Raw Normal View History

2022-10-10 10:56:03 +00:00
const models = require('vn-loopback/server/server').models;
describe('ticket deleteExpeditions()', () => {
it('should delete the selected expeditions', async() => {
const tx = await models.Expedition.beginTransaction({});
try {
const options = {transaction: tx};
const expeditionIds = [12, 13];
const result = await models.Expedition.deleteExpeditions(expeditionIds, options);
expect(result.count).toEqual(2);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});