From 3ac7afd6b587107e397e53c803190e979ed24cb1 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Sun, 19 Apr 2026 21:28:04 +1200 Subject: [PATCH] fix(tests): fix 3 pre-existing test failures - OutputNode download tests: add missing `ok: true` to fetch mock responses so downloadMedia doesn't bail at the `!response.ok` check - workflowStore integration test: update easeCurve bounding box expectations from 480 to 280 to match actual default dimensions Co-Authored-By: Claude Opus 4.6 --- src/components/__tests__/OutputNode.test.tsx | 2 ++ src/store/__tests__/workflowStore.integration.test.ts | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/__tests__/OutputNode.test.tsx b/src/components/__tests__/OutputNode.test.tsx index 986057d5..473c6d08 100644 --- a/src/components/__tests__/OutputNode.test.tsx +++ b/src/components/__tests__/OutputNode.test.tsx @@ -439,6 +439,7 @@ describe("OutputNode", () => { it("should fetch and download for URL-based content", async () => { const mockBlob = new Blob(["test"], { type: "image/png" }); const mockFetch = vi.fn().mockResolvedValue({ + ok: true, blob: () => Promise.resolve(mockBlob), }); global.fetch = mockFetch; @@ -501,6 +502,7 @@ describe("OutputNode", () => { it("should revoke blob URL after download for HTTP content", async () => { const mockBlob = new Blob(["test"], { type: "image/png" }); global.fetch = vi.fn().mockResolvedValue({ + ok: true, blob: () => Promise.resolve(mockBlob), }); diff --git a/src/store/__tests__/workflowStore.integration.test.ts b/src/store/__tests__/workflowStore.integration.test.ts index bc5a9b7d..878e6962 100644 --- a/src/store/__tests__/workflowStore.integration.test.ts +++ b/src/store/__tests__/workflowStore.integration.test.ts @@ -2474,7 +2474,7 @@ describe("workflowStore integration tests", () => { describe("Group operations with non-standard node types", () => { describe("createGroup bounding box calculation", () => { - it("should correctly calculate bounding box for easeCurve nodes (340x480)", () => { + it("should correctly calculate bounding box for easeCurve nodes (340x280)", () => { useWorkflowStore.setState({ nodes: [ createTestNode("ease-1", "easeCurve", { @@ -2509,10 +2509,10 @@ describe("workflowStore integration tests", () => { expect(groupId).toBeTruthy(); const group = useWorkflowStore.getState().groups[groupId]; - // easeCurve is 340x480, so maxX = 500 + 340 = 840, maxY = 100 + 480 = 580 + // easeCurve is 340x280, so maxX = 500 + 340 = 840, maxY = 100 + 280 = 380 // With padding=20 and headerHeight=32: 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.height).toBeGreaterThanOrEqual(480); // Must account for 480px tall nodes + expect(group.size.height).toBeGreaterThanOrEqual(280); // Must account for 280px tall nodes }); it("should correctly calculate bounding box for videoStitch nodes (400x280)", () => {