feat: add backTest
This commit is contained in:
parent
1e587be2ed
commit
a5b3bdfa8d
|
@ -46,15 +46,64 @@ describe('Travel extraCommunityFilter()', () => {
|
|||
expect(result.length).toEqual(3);
|
||||
});
|
||||
|
||||
it('should return the routes matching "landed from" and "landed to"', async() => {
|
||||
const from = new Date();
|
||||
const to = new Date();
|
||||
from.setHours(0, 0, 0, 0);
|
||||
to.setHours(23, 59, 59, 999);
|
||||
to.setDate(to.getDate() + 14);
|
||||
it('should return the travel matching "warehouse in"', async() => {
|
||||
const ctx = {
|
||||
args: {
|
||||
landedFrom: from,
|
||||
warehouseInFk: 1
|
||||
}
|
||||
};
|
||||
|
||||
const result = await app.models.Travel.extraCommunityFilter(ctx, filter);
|
||||
|
||||
expect(result.length).toEqual(4);
|
||||
});
|
||||
|
||||
it('should return the travel matching "continent"', async() => {
|
||||
const ctx = {
|
||||
args: {
|
||||
continent: 'AM'
|
||||
}
|
||||
};
|
||||
|
||||
const result = await app.models.Travel.extraCommunityFilter(ctx, filter);
|
||||
|
||||
expect(result.length).toEqual(3);
|
||||
});
|
||||
|
||||
it('should return the travel matching "agencyFk"', async() => {
|
||||
const ctx = {
|
||||
args: {
|
||||
agencyFk: 1
|
||||
}
|
||||
};
|
||||
|
||||
const result = await app.models.Travel.extraCommunityFilter(ctx, filter);
|
||||
|
||||
expect(result.length).toEqual(8);
|
||||
});
|
||||
|
||||
it('should return the travel matching "cargoSupplierFk"', async() => {
|
||||
const ctx = {
|
||||
args: {
|
||||
cargoSupplierFk: 1
|
||||
}
|
||||
};
|
||||
|
||||
const result = await app.models.Travel.extraCommunityFilter(ctx, filter);
|
||||
|
||||
expect(result.length).toEqual(4);
|
||||
});
|
||||
|
||||
it('should return the routes matching "shipped from" and "landed to"', async() => {
|
||||
const from = new Date();
|
||||
from.setDate(from.getDate() - 2);
|
||||
from.setHours(0, 0, 0, 0);
|
||||
const to = new Date();
|
||||
to.setHours(23, 59, 59, 999);
|
||||
to.setDate(to.getDate() + 7);
|
||||
const ctx = {
|
||||
args: {
|
||||
shippedFrom: from,
|
||||
landedTo: to
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue