Browse Source

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 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 3 months ago
parent
commit
3ac7afd6b5
  1. 2
      src/components/__tests__/OutputNode.test.tsx
  2. 6
      src/store/__tests__/workflowStore.integration.test.ts

2
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),
});

6
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)", () => {

Loading…
Cancel
Save