3888-ticket.expedition_moveExpedition #1097

Merged
vicent merged 26 commits from 3888-ticket.expedition_moveExpedition into dev 2022-11-02 13:54:11 +00:00
2 changed files with 45 additions and 0 deletions
Showing only changes of commit 843f67919c - Show all commits

View File

@ -0,0 +1,22 @@
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;
}
});
});

View File

@ -0,0 +1,23 @@
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;
}
});
});