Skip to content

Commit dc8bea3

Browse files
fix: align socket test mocks and auto-connect deps
1 parent c5724b7 commit dc8bea3

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ const WorkflowContent = React.memo(
810810
)
811811
usePanelEditorStore.getState().setCurrentBlockId(id)
812812
},
813-
[collaborativeBatchAddBlocks, setSelectedEdges, setPendingSelection]
813+
[collaborativeBatchAddBlocks, isAutoConnectEnabled, setSelectedEdges, setPendingSelection]
814814
)
815815

816816
const { activeBlockIds, pendingBlocks, isDebugging, isExecuting } = useExecutionStore(
@@ -1124,6 +1124,7 @@ const WorkflowContent = React.memo(
11241124
addNotification,
11251125
activeWorkflowId,
11261126
collaborativeBatchAddBlocks,
1127+
isAutoConnectEnabled,
11271128
setPendingSelection,
11281129
resizeLoopNodesWrapper,
11291130
]

apps/sim/vitest.setup.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ import {
88
import { afterAll, vi } from 'vitest'
99
import '@testing-library/jest-dom/vitest'
1010

11+
const MOCK_BLOCK_TYPES = [
12+
'action',
13+
'agent',
14+
'api',
15+
'function',
16+
'condition',
17+
'router',
18+
'slack',
19+
'gmail',
20+
'google_sheets',
21+
'webhook',
22+
'api_trigger',
23+
'schedule',
24+
'starter',
25+
'response',
26+
] as const
27+
1128
setupGlobalFetchMock()
1229
setupGlobalStorageMocks()
1330

@@ -78,7 +95,13 @@ vi.mock('@/blocks/registry', () => ({
7895
subBlocks: [],
7996
outputs: {},
8097
})),
98+
getAllBlockTypes: vi.fn(() => [...MOCK_BLOCK_TYPES]),
8199
getAllBlocks: vi.fn(() => ({})),
100+
isValidBlockType: vi.fn(
101+
(type: string) =>
102+
MOCK_BLOCK_TYPES.includes(type as (typeof MOCK_BLOCK_TYPES)[number]) ||
103+
MOCK_BLOCK_TYPES.includes(type.replace(/-/g, '_') as (typeof MOCK_BLOCK_TYPES)[number])
104+
),
82105
}))
83106

84107
vi.mock('@trigger.dev/sdk', () => ({

0 commit comments

Comments
 (0)