22 lines
640 B
JavaScript
22 lines
640 B
JavaScript
const app = require('vn-loopback/server/server');
|
|
|
|
describe('Agency landsThatDay()', () => {
|
|
const today = new Date();
|
|
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({});
|
|
|
|
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;
|
|
}
|
|
});
|
|
});
|