salix/modules/ticket/back/methods/packaging/specs/listPackaging.spec.js

23 lines
624 B
JavaScript
Raw Normal View History

const models = require('vn-loopback/server/server').models;
2018-08-10 09:40:48 +00:00
describe('ticket listPackaging()', () => {
2020-10-15 16:57:27 +00:00
it('should return the packaging', async() => {
const tx = await models.Packaging.beginTransaction({});
2018-08-10 09:40:48 +00:00
try {
const options = {transaction: tx};
const filter = {where: {packagingFk: 1}};
2022-08-04 07:53:22 +00:00
const [response] = await models.Packaging.listPackaging(filter, options);
2022-08-04 07:53:22 +00:00
expect(response.name).toEqual('Container ammo box 1m');
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
2018-08-10 09:40:48 +00:00
});
});