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

22 lines
642 B
JavaScript
Raw Normal View History

2019-05-13 12:34:37 +00:00
const app = require('vn-loopback/server/server');
2019-11-18 11:32:50 +00:00
describe('Agency landsThatDay()', () => {
2023-01-16 14:18:24 +00:00
const today = Date.vnNew();
2019-05-13 12:34:37 +00:00
it('should return a list of agencies that can land a shipment on a day for an address', async() => {
const tx = await app.models.Agency.beginTransaction({});
2019-05-13 12:34:37 +00:00
try {
const options = {transaction: tx};
const agencies = await app.models.Agency.landsThatDay(101, today, options);
expect(agencies.length).toBeGreaterThanOrEqual(3);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
2019-05-13 12:34:37 +00:00
});
});