feat(canvas): finalize mixer reconnect swap and related updates
This commit is contained in:
31
tests/canvas-connection-validation.test.ts
Normal file
31
tests/canvas-connection-validation.test.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { validateCanvasEdgeSplit } from "@/components/canvas/canvas-connection-validation";
|
||||
|
||||
describe("validateCanvasEdgeSplit", () => {
|
||||
it("uses middle-node target handle for first split leg", () => {
|
||||
const reason = validateCanvasEdgeSplit({
|
||||
nodes: [
|
||||
{ id: "node-source", type: "image", position: { x: 0, y: 0 }, data: {} },
|
||||
{ id: "node-target", type: "compare", position: { x: 400, y: 0 }, data: {} },
|
||||
],
|
||||
edges: [
|
||||
{
|
||||
id: "edge-source-target",
|
||||
source: "node-source",
|
||||
target: "node-target",
|
||||
targetHandle: "left",
|
||||
},
|
||||
],
|
||||
splitEdge: {
|
||||
id: "edge-source-target",
|
||||
source: "node-source",
|
||||
target: "node-target",
|
||||
targetHandle: "left",
|
||||
},
|
||||
middleNode: { id: "node-middle", type: "mixer", position: { x: 200, y: 0 }, data: {} },
|
||||
});
|
||||
|
||||
expect(reason).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user