mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 18:48:11 +00:00
feat(billing): USD offline bank-transfer payments
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { WagonReadiness } from '@edr/types';
|
||||
|
||||
import {
|
||||
requiredWagonReadiness,
|
||||
wagonReadinessMatchesSchedule,
|
||||
} from './wagon-readiness.util';
|
||||
|
||||
describe('wagonReadinessMatchesSchedule', () => {
|
||||
it('requires IMPORT_READY for IMPORT schedules', () => {
|
||||
expect(requiredWagonReadiness('IMPORT')).toBe(WagonReadiness.ImportReady);
|
||||
expect(
|
||||
wagonReadinessMatchesSchedule(WagonReadiness.ImportReady, 'IMPORT'),
|
||||
).toBe(true);
|
||||
expect(
|
||||
wagonReadinessMatchesSchedule(WagonReadiness.ExportReady, 'IMPORT'),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('requires EXPORT_READY for EXPORT schedules', () => {
|
||||
expect(requiredWagonReadiness('EXPORT')).toBe(WagonReadiness.ExportReady);
|
||||
expect(
|
||||
wagonReadinessMatchesSchedule(WagonReadiness.ExportReady, 'EXPORT'),
|
||||
).toBe(true);
|
||||
expect(
|
||||
wagonReadinessMatchesSchedule(WagonReadiness.ImportReady, 'EXPORT'),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('allows any readiness for DOMESTIC schedules', () => {
|
||||
expect(requiredWagonReadiness('DOMESTIC')).toBeNull();
|
||||
expect(
|
||||
wagonReadinessMatchesSchedule(WagonReadiness.ExportReady, 'DOMESTIC'),
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user