salix/modules/zone/back/methods/agency/specs/landsThatDay.spec.js

22 lines
639 B
JavaScript

const {models} = require('vn-loopback/server/server');
describe('Agency landsThatDay()', () => {
const today = Date.vnNew();
it('should return a list of agencies that can land a shipment on a day for an address', async() => {
const tx = await models.Agency.beginTransaction({});
try {
const options = {transaction: tx};
const agencies = await models.Agency.landsThatDay(101, today, options);
expect(agencies.length).toBeGreaterThanOrEqual(3);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});