refactor(web): extract allocation drag action plans
This commit is contained in:
@@ -76,28 +76,21 @@ describe("timelineAllocationFinalize", () => {
|
||||
it("requires extraction only for segment drags that no longer match allocation boundaries", () => {
|
||||
expect(
|
||||
requiresAllocationFragmentExtraction({
|
||||
mode: "move",
|
||||
scope: "segment",
|
||||
allocationId: "alloc-1",
|
||||
mutationAllocationId: null,
|
||||
projectName: "Alpha",
|
||||
...baseDates,
|
||||
originalStartDate: baseDates.originalStartDate,
|
||||
originalEndDate: baseDates.originalEndDate,
|
||||
allocationStartDate: new Date("2024-12-31T00:00:00.000Z"),
|
||||
pointerDeltaX: 0,
|
||||
daysDelta: 1,
|
||||
allocationEndDate: baseDates.allocationEndDate,
|
||||
}),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
requiresAllocationFragmentExtraction({
|
||||
mode: "move",
|
||||
scope: "allocation",
|
||||
allocationId: "alloc-1",
|
||||
mutationAllocationId: null,
|
||||
projectName: "Alpha",
|
||||
...baseDates,
|
||||
pointerDeltaX: 0,
|
||||
daysDelta: 1,
|
||||
originalStartDate: baseDates.originalStartDate,
|
||||
originalEndDate: baseDates.originalEndDate,
|
||||
allocationStartDate: baseDates.allocationStartDate,
|
||||
allocationEndDate: baseDates.allocationEndDate,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
@@ -105,14 +98,13 @@ describe("timelineAllocationFinalize", () => {
|
||||
it("returns null snapshots when required dates or ids are missing", () => {
|
||||
expect(
|
||||
buildAllocationMovedSnapshot({
|
||||
mode: "move",
|
||||
scope: "allocation",
|
||||
allocationId: null,
|
||||
mutationAllocationId: null,
|
||||
projectName: "Alpha",
|
||||
...baseDates,
|
||||
pointerDeltaX: 0,
|
||||
daysDelta: 1,
|
||||
originalStartDate: baseDates.originalStartDate,
|
||||
originalEndDate: baseDates.originalEndDate,
|
||||
currentStartDate: baseDates.currentStartDate,
|
||||
currentEndDate: baseDates.currentEndDate,
|
||||
}),
|
||||
).toBeNull();
|
||||
});
|
||||
@@ -120,16 +112,13 @@ describe("timelineAllocationFinalize", () => {
|
||||
it("builds a mutation snapshot with fallback mutation allocation ids", () => {
|
||||
expect(
|
||||
buildAllocationMovedSnapshot({
|
||||
mode: "move",
|
||||
scope: "allocation",
|
||||
allocationId: "alloc-1",
|
||||
mutationAllocationId: null,
|
||||
projectName: null,
|
||||
...baseDates,
|
||||
originalStartDate: baseDates.originalStartDate,
|
||||
originalEndDate: baseDates.originalEndDate,
|
||||
currentStartDate: new Date("2025-01-02T00:00:00.000Z"),
|
||||
currentEndDate: new Date("2025-01-06T00:00:00.000Z"),
|
||||
pointerDeltaX: 32,
|
||||
daysDelta: 1,
|
||||
}),
|
||||
).toEqual({
|
||||
allocationId: "alloc-1",
|
||||
|
||||
Reference in New Issue
Block a user