refs #6184 saveCmr #1788
|
@ -6,6 +6,7 @@ describe('route downloadCmrsZip()', () => {
|
|||
});
|
||||
|
||||
it('should create a zip file with the given cmr ids', async() => {
|
||||
const tx = await models.Route.beginTransaction({});
|
||||
const ctx = {
|
||||
req: {
|
||||
getLocale: () => {
|
||||
|
@ -15,8 +16,14 @@ describe('route downloadCmrsZip()', () => {
|
|||
}
|
||||
};
|
||||
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();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('Ticket saveCmr()', () => {
|
||||
describe('ticket saveCmr()', () => {
|
||||
let ctx = {req: {
|
||||
accessToken: {userId: 9}
|
||||
}};
|
||||
|
|
Loading…
Reference in New Issue