refs #6184 saveCmr #1788

Merged
guillermo merged 58 commits from 6184-saveCmr into dev 2024-02-13 06:47:06 +00:00
2 changed files with 10 additions and 3 deletions
Showing only changes of commit d39d54a514 - Show all commits

View File

@ -6,6 +6,7 @@ describe('route downloadCmrsZip()', () => {
}); });
it('should create a zip file with the given cmr ids', async() => { it('should create a zip file with the given cmr ids', async() => {
const tx = await models.Route.beginTransaction({});
const ctx = { const ctx = {
req: { req: {
getLocale: () => { getLocale: () => {
@ -15,8 +16,14 @@ describe('route downloadCmrsZip()', () => {
} }
}; };
let cmrs = '1,2'; let cmrs = '1,2';
let result = await models.Route.downloadCmrsZip(ctx, cmrs); try {
await models.Route.downloadCmrsZip(ctx, cmrs);
await tx.rollback();
} catch (e) {
error = e;
await tx.rollback();
}
expect(result.length).toBeGreaterThanOrEqual(1); expect(error).toBeDefined();
}); });
}); });

View File

@ -1,6 +1,6 @@
const models = require('vn-loopback/server/server').models; const models = require('vn-loopback/server/server').models;
describe('Ticket saveCmr()', () => { describe('ticket saveCmr()', () => {
let ctx = {req: { let ctx = {req: {
accessToken: {userId: 9} accessToken: {userId: 9}
}}; }};