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:
@@ -73,6 +73,7 @@ describe("useCanvasDeleteHandlers", () => {
|
||||
|
||||
afterEach(async () => {
|
||||
latestHandlersRef.current = null;
|
||||
vi.useRealTimers();
|
||||
vi.clearAllMocks();
|
||||
consoleErrorSpy?.mockRestore();
|
||||
consoleInfoSpy?.mockRestore();
|
||||
@@ -148,7 +149,8 @@ describe("useCanvasDeleteHandlers", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("logs bridge payload details when bridge edge creation fails", async () => {
|
||||
it("logs bridge payload details when bridge edge creation retries are exhausted", async () => {
|
||||
vi.useFakeTimers();
|
||||
consoleErrorSpy = vi.spyOn(console, "error").mockImplementation(() => undefined);
|
||||
consoleInfoSpy = vi.spyOn(console, "info").mockImplementation(() => undefined);
|
||||
|
||||
@@ -200,9 +202,12 @@ describe("useCanvasDeleteHandlers", () => {
|
||||
await act(async () => {
|
||||
resolveBatchRemove?.();
|
||||
await Promise.resolve();
|
||||
await vi.runAllTimersAsync();
|
||||
await Promise.resolve();
|
||||
});
|
||||
|
||||
expect(runCreateEdgeMutation).toHaveBeenCalledTimes(4);
|
||||
|
||||
expect(consoleErrorSpy).toHaveBeenCalledWith(
|
||||
"[Canvas] bridge edge create failed",
|
||||
expect.objectContaining({
|
||||
@@ -214,7 +219,9 @@ describe("useCanvasDeleteHandlers", () => {
|
||||
sourceHandle: undefined,
|
||||
targetHandle: undefined,
|
||||
},
|
||||
error: bridgeError,
|
||||
attempt: 4,
|
||||
maxAttempts: 4,
|
||||
error: bridgeError.message,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user