mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 03:40:56 +00:00
booking operations and trains scheduling also allocations
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { compareSchedulingPriority } from "./compareSchedulingPriority";
|
||||
|
||||
describe("compareSchedulingPriority", () => {
|
||||
it("ranks government above commercial regardless of date gap", () => {
|
||||
const gov = {
|
||||
isGovernment: true,
|
||||
priorityScore: 100,
|
||||
scheduledDate: "2026-06-25T08:00:00.000Z",
|
||||
};
|
||||
const commercial = {
|
||||
isGovernment: false,
|
||||
priorityScore: 50000,
|
||||
scheduledDate: "2026-06-20T08:00:00.000Z",
|
||||
};
|
||||
expect(compareSchedulingPriority(gov, commercial)).toBeLessThan(0);
|
||||
});
|
||||
|
||||
it("sorts by priority score within same tier", () => {
|
||||
const high = { priorityScore: 100, scheduledDate: "2026-06-20T08:00:00.000Z" };
|
||||
const low = { priorityScore: 10, scheduledDate: "2026-06-20T08:00:00.000Z" };
|
||||
expect(compareSchedulingPriority(high, low)).toBeLessThan(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user