mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 12:18:11 +00:00
ui design for schedule
This commit is contained in:
@@ -105,6 +105,22 @@ describe('containerPlacement.util', () => {
|
||||
expect(placements[2]?.sequenceNo).toBe(2);
|
||||
});
|
||||
|
||||
it('never shares a wagon between a 40ft and a 20ft when the 40ft comes first', () => {
|
||||
// Regression: a 40ft (2 TEU) must occupy its own wagon and never pair with a 20ft.
|
||||
const units40 = makeUnits('40GP', 40, 1);
|
||||
const units20 = makeUnits('20GP', 20, 2);
|
||||
const units = [...units40, ...units20];
|
||||
const slots = [1, 2, 3, 4];
|
||||
const placements = autoFillPlacements(units, slots);
|
||||
|
||||
expect(placements).toHaveLength(3);
|
||||
// 40ft alone on slot 1
|
||||
expect(placements[0]?.sequenceNo).toBe(1);
|
||||
// both 20ft together on slot 2 — NOT on slot 1 with the 40ft
|
||||
expect(placements[1]?.sequenceNo).toBe(2);
|
||||
expect(placements[2]?.sequenceNo).toBe(2);
|
||||
});
|
||||
|
||||
it('falls back to last slot when running out of slots', () => {
|
||||
const units = makeUnits('20GP', 20, 6);
|
||||
const slots = [1, 2]; // Only 2 slots available
|
||||
|
||||
Reference in New Issue
Block a user