|
|
@ -634,7 +634,7 @@ describe("workflowStore integration tests", () => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const node = useWorkflowStore.getState().nodes[0]; |
|
|
const node = useWorkflowStore.getState().nodes[0]; |
|
|
expect(node).toMatchObject({ style: { width: 203, height: 360 } }); |
|
|
expect(node).toMatchObject({ style: { width: 346, height: 615 } }); |
|
|
expect(useWorkflowStore.getState().hasUnsavedChanges).toBe(true); |
|
|
expect(useWorkflowStore.getState().hasUnsavedChanges).toBe(true); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
@ -685,7 +685,7 @@ describe("workflowStore integration tests", () => { |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const node = useWorkflowStore.getState().nodes.find((candidate) => candidate.id === nodeId); |
|
|
const node = useWorkflowStore.getState().nodes.find((candidate) => candidate.id === nodeId); |
|
|
expect(node?.style).toMatchObject({ width: 203, height: 360 }); |
|
|
expect(node?.style).toMatchObject({ width: 346, height: 615 }); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
it("infers generation node dimensions from model parameter ratio", () => { |
|
|
it("infers generation node dimensions from model parameter ratio", () => { |
|
|
@ -696,7 +696,7 @@ describe("workflowStore integration tests", () => { |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const node = useWorkflowStore.getState().nodes.find((candidate) => candidate.id === nodeId); |
|
|
const node = useWorkflowStore.getState().nodes.find((candidate) => candidate.id === nodeId); |
|
|
expect(node?.style).toMatchObject({ width: 360, height: 203 }); |
|
|
expect(node?.style).toMatchObject({ width: 615, height: 346 }); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
it("infers media node dimensions from initial media dimensions", () => { |
|
|
it("infers media node dimensions from initial media dimensions", () => { |
|
|
@ -2130,7 +2130,7 @@ describe("workflowStore integration tests", () => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
describe("createGroup bounding box calculation", () => { |
|
|
describe("createGroup bounding box calculation", () => { |
|
|
it("should correctly calculate bounding box for easeCurve nodes (340x280)", () => { |
|
|
it("should correctly calculate bounding box for easeCurve nodes (340x260)", () => { |
|
|
useWorkflowStore.setState({ |
|
|
useWorkflowStore.setState({ |
|
|
nodes: [ |
|
|
nodes: [ |
|
|
createTestNode("ease-1", "easeCurve", { |
|
|
createTestNode("ease-1", "easeCurve", { |
|
|
@ -2173,13 +2173,13 @@ describe("workflowStore integration tests", () => { |
|
|
|
|
|
|
|
|
expect(groupId).toBeTruthy(); |
|
|
expect(groupId).toBeTruthy(); |
|
|
const group = useWorkflowStore.getState().groups[groupId]; |
|
|
const group = useWorkflowStore.getState().groups[groupId]; |
|
|
// easeCurve is 340x280, so maxX = 500 + 340 = 840, maxY = 100 + 280 = 380
|
|
|
// easeCurve is 340x260, so maxX = 500 + 340 = 840, maxY = 100 + 260 = 360
|
|
|
// With padding=20: position.x = 100-20=80, width = 840-100+40=780
|
|
|
// With padding=20: position.x = 100-20=80, width = 840-100+40=780
|
|
|
expect(group.size.width).toBeGreaterThanOrEqual(740); // Must account for 340px wide nodes
|
|
|
expect(group.size.width).toBeGreaterThanOrEqual(740); // Must account for 340px wide nodes
|
|
|
expect(group.size.height).toBeGreaterThanOrEqual(280); // Must account for 280px tall nodes
|
|
|
expect(group.size.height).toBeGreaterThanOrEqual(260); // Must account for 260px tall nodes
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
it("should correctly calculate bounding box for videoStitch nodes (400x280)", () => { |
|
|
it("should correctly calculate bounding box for videoStitch nodes (420x280)", () => { |
|
|
useWorkflowStore.setState({ |
|
|
useWorkflowStore.setState({ |
|
|
nodes: [ |
|
|
nodes: [ |
|
|
createTestNode("vs-1", "videoStitch", { |
|
|
createTestNode("vs-1", "videoStitch", { |
|
|
@ -2208,8 +2208,8 @@ describe("workflowStore integration tests", () => { |
|
|
const groupId = store.createGroup(["vs-1"]); |
|
|
const groupId = store.createGroup(["vs-1"]); |
|
|
|
|
|
|
|
|
const group = useWorkflowStore.getState().groups[groupId]; |
|
|
const group = useWorkflowStore.getState().groups[groupId]; |
|
|
// videoStitch is 400x280, with padding=20: width = 400+40=440
|
|
|
// videoStitch is 420x280, with padding=20: width = 420+40=460
|
|
|
expect(group.size.width).toBeGreaterThanOrEqual(400); // Must account for 400px wide node
|
|
|
expect(group.size.width).toBeGreaterThanOrEqual(420); // Must account for 420px wide node
|
|
|
expect(group.size.height).toBeGreaterThanOrEqual(280); // Must account for 280px tall node
|
|
|
expect(group.size.height).toBeGreaterThanOrEqual(280); // Must account for 280px tall node
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
@ -2241,7 +2241,7 @@ describe("workflowStore integration tests", () => { |
|
|
expect(imageNode?.position).toEqual({ x: 0, y: 0 }); |
|
|
expect(imageNode?.position).toEqual({ x: 0, y: 0 }); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
it("should correctly calculate bounding box for audioInput nodes (300x200)", () => { |
|
|
it("should correctly calculate bounding box for audioInput nodes (320x180)", () => { |
|
|
useWorkflowStore.setState({ |
|
|
useWorkflowStore.setState({ |
|
|
nodes: [ |
|
|
nodes: [ |
|
|
createTestNode("audio-1", "audioInput", { |
|
|
createTestNode("audio-1", "audioInput", { |
|
|
@ -2259,9 +2259,9 @@ describe("workflowStore integration tests", () => { |
|
|
const groupId = store.createGroup(["audio-1"]); |
|
|
const groupId = store.createGroup(["audio-1"]); |
|
|
|
|
|
|
|
|
const group = useWorkflowStore.getState().groups[groupId]; |
|
|
const group = useWorkflowStore.getState().groups[groupId]; |
|
|
// audioInput is 300x200, with padding=20: width = 300+40=340
|
|
|
// audioInput is 320x180, with padding=20: width = 320+40=360
|
|
|
expect(group.size.width).toBeGreaterThanOrEqual(300); |
|
|
expect(group.size.width).toBeGreaterThanOrEqual(320); |
|
|
expect(group.size.height).toBeGreaterThanOrEqual(200); |
|
|
expect(group.size.height).toBeGreaterThanOrEqual(180); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
it("should replace selected existing groups when creating a new group", () => { |
|
|
it("should replace selected existing groups when creating a new group", () => { |
|
|
|