30 lines
896 B
JavaScript
30 lines
896 B
JavaScript
const app = require('vn-loopback/server/server');
|
|
|
|
describe('agency getShipped()', () => {
|
|
it('should return a shipment date', async() => {
|
|
const landed = new Date();
|
|
landed.setDate(landed.getDate() + 1);
|
|
const addressFk = 121;
|
|
const agencyModeFk = 7;
|
|
const warehouseFk = 1;
|
|
|
|
let result = await app.models.Agency.getShipped(landed, addressFk, agencyModeFk, warehouseFk);
|
|
|
|
expect(result).toBeDefined();
|
|
});
|
|
|
|
it('should not return a shipment date', async() => {
|
|
let newDate = new Date();
|
|
newDate.setMonth(newDate.getMonth() - 1);
|
|
|
|
const landed = newDate;
|
|
const addressFk = 121;
|
|
const agencyModeFk = 7;
|
|
const warehouseFk = 1;
|
|
|
|
let result = await app.models.Agency.getShipped(landed, addressFk, agencyModeFk, warehouseFk);
|
|
|
|
expect(result).toBeUndefined();
|
|
});
|
|
});
|