fix: #6184 Requested changes

This commit is contained in:
Guillermo Bonet 2024-01-30 09:50:53 +01:00
parent 1e56e741e2
commit d39d54a514
2 changed files with 10 additions and 3 deletions

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}
}}; }};