Files
edr-platform/apps/edr-freight-api/src/modules/train-scheduling/derive-schedule-direction.util.spec.ts

22 lines
684 B
TypeScript

import { deriveScheduleDirection } from './derive-schedule-direction.util';
describe('deriveScheduleDirection', () => {
it('returns IMPORT when origin is Djibouti', () => {
expect(
deriveScheduleDirection({ country: 'Djibouti' }, { country: 'Ethiopia' }),
).toBe('IMPORT');
});
it('returns EXPORT when destination is Djibouti and origin is not', () => {
expect(
deriveScheduleDirection({ country: 'Ethiopia' }, { country: 'Djibouti' }),
).toBe('EXPORT');
});
it('returns DOMESTIC for intra-Ethiopia routes', () => {
expect(
deriveScheduleDirection({ country: 'Ethiopia' }, { country: 'Ethiopia' }),
).toBe('DOMESTIC');
});
});