Enhance canvas functionality by adding media preview capabilities and image upload handling. Introduce compressed image previews during uploads, improve media library integration, and implement retry logic for bridge edge creation. Update dashboard to display media previews and optimize image node handling.
This commit is contained in:
@@ -62,6 +62,88 @@ describe("canvas connection policy", () => {
|
||||
).toBe("adjustment-source-invalid");
|
||||
});
|
||||
|
||||
it("allows image sources to crop", () => {
|
||||
expect(
|
||||
validateCanvasConnectionPolicy({
|
||||
sourceType: "image",
|
||||
targetType: "crop",
|
||||
targetIncomingCount: 0,
|
||||
}),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("allows video sources to crop", () => {
|
||||
expect(
|
||||
validateCanvasConnectionPolicy({
|
||||
sourceType: "video",
|
||||
targetType: "crop",
|
||||
targetIncomingCount: 0,
|
||||
}),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("allows ai-video sources to crop", () => {
|
||||
expect(
|
||||
validateCanvasConnectionPolicy({
|
||||
sourceType: "ai-video",
|
||||
targetType: "crop",
|
||||
targetIncomingCount: 0,
|
||||
}),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("allows chained crop nodes", () => {
|
||||
expect(
|
||||
validateCanvasConnectionPolicy({
|
||||
sourceType: "crop",
|
||||
targetType: "crop",
|
||||
targetIncomingCount: 0,
|
||||
}),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("blocks unsupported crop sources", () => {
|
||||
expect(
|
||||
validateCanvasConnectionPolicy({
|
||||
sourceType: "prompt",
|
||||
targetType: "crop",
|
||||
targetIncomingCount: 0,
|
||||
}),
|
||||
).toBe("crop-source-invalid");
|
||||
});
|
||||
|
||||
it("limits crop nodes to one incoming connection", () => {
|
||||
expect(
|
||||
validateCanvasConnectionPolicy({
|
||||
sourceType: "image",
|
||||
targetType: "crop",
|
||||
targetIncomingCount: 1,
|
||||
}),
|
||||
).toBe("crop-incoming-limit");
|
||||
});
|
||||
|
||||
it("allows crop output as render source", () => {
|
||||
expect(
|
||||
validateCanvasConnectionPolicy({
|
||||
sourceType: "crop",
|
||||
targetType: "render",
|
||||
targetIncomingCount: 0,
|
||||
}),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("describes unsupported crop source message", () => {
|
||||
expect(getCanvasConnectionValidationMessage("crop-source-invalid")).toBe(
|
||||
"Crop akzeptiert nur Bild-, Asset-, KI-Bild-, Video-, KI-Video-, Crop- oder Adjustment-Input.",
|
||||
);
|
||||
});
|
||||
|
||||
it("describes crop incoming limit", () => {
|
||||
expect(getCanvasConnectionValidationMessage("crop-incoming-limit")).toBe(
|
||||
"Crop-Nodes erlauben genau eine eingehende Verbindung.",
|
||||
);
|
||||
});
|
||||
|
||||
it("blocks ai-video as render source", () => {
|
||||
expect(
|
||||
validateCanvasConnectionPolicy({
|
||||
|
||||
Reference in New Issue
Block a user