mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 07:51:02 +00:00
26 lines
881 B
TypeScript
26 lines
881 B
TypeScript
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);
|
|
});
|
|
});
|