Skip to content

Commit 18af6ed

Browse files
committed
fix(tests): add missing mocks for new URL utility exports
Update lifecycle, async execute, and chat manage test mocks to include getSocketServerUrl, getOllamaUrl, and notifySocketDeploymentChanged.
1 parent 0daddf6 commit 18af6ed

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

apps/sim/app/api/chat/manage/[id]/route.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ vi.mock('@/lib/workflows/persistence/utils', () => ({
8989
}))
9090
vi.mock('@/lib/workflows/orchestration', () => ({
9191
performChatUndeploy: mockPerformChatUndeploy,
92+
notifySocketDeploymentChanged: vi.fn().mockResolvedValue(undefined),
9293
}))
9394
vi.mock('drizzle-orm', () => ({
9495
and: vi.fn((...conditions: unknown[]) => ({ type: 'and', conditions })),

apps/sim/app/api/workflows/[id]/execute/route.async.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ vi.mock('@/lib/core/utils/request', () => ({
5353

5454
vi.mock('@/lib/core/utils/urls', () => ({
5555
getBaseUrl: vi.fn().mockReturnValue('http://localhost:3000'),
56+
getOllamaUrl: vi.fn().mockReturnValue('http://localhost:11434'),
5657
}))
5758

5859
vi.mock('@/lib/execution/call-chain', () => ({

apps/sim/lib/workflows/lifecycle.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ vi.mock('@/lib/core/config/env', () => ({
5656
SOCKET_SERVER_URL: 'http://socket.test',
5757
INTERNAL_API_SECRET: 'secret',
5858
},
59+
getEnv: vi.fn(),
60+
}))
61+
62+
vi.mock('@/lib/core/utils/urls', () => ({
63+
getSocketServerUrl: vi.fn().mockReturnValue('http://socket.test'),
5964
}))
6065

6166
vi.mock('@/lib/core/telemetry', () => ({

0 commit comments

Comments
 (0)