24 lines
654 B
JavaScript
24 lines
654 B
JavaScript
const models = require('vn-loopback/server/server').models;
|
|
|
|
describe('ticket moveExpeditions()', () => {
|
|
it('should delete the selected expeditions', async() => {
|
|
const tx = await models.Expedition.beginTransaction({});
|
|
|
|
try {
|
|
const options = {transaction: tx};
|
|
|
|
const expeditionIds = [12, 13];
|
|
const ticketId = 1;
|
|
const result = await models.Expedition.moveExpeditions(expeditionIds, ticketId, options);
|
|
|
|
expect(result.length).toEqual(2);
|
|
|
|
await tx.rollback();
|
|
} catch (e) {
|
|
await tx.rollback();
|
|
throw e;
|
|
}
|
|
});
|
|
});
|
|
|