Skip to content

Commit 63ea1ef

Browse files
committed
fix(tests): route agent-handler MCP server rows through queueTableRows
1 parent e82171d commit 63ea1ef

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

apps/sim/executor/handlers/agent/agent-handler.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { dbChainMock, dbChainMockFns, resetDbChainMock } from '@sim/testing'
1+
import { dbChainMock, queueTableRows, resetDbChainMock, schemaMock } from '@sim/testing'
22
import { afterAll, afterEach, beforeEach, describe, expect, it, type Mock, vi } from 'vitest'
33
import { getAllBlocks } from '@/blocks'
44
import { BlockType, isMcpTool } from '@/executor/constants'
@@ -119,8 +119,9 @@ describe('AgentBlockHandler', () => {
119119
handler = new AgentBlockHandler()
120120
vi.clearAllMocks()
121121
resetDbChainMock()
122-
// The MCP server lookup awaits select().from(mcpServers).where(...) directly.
123-
dbChainMockFns.where.mockResolvedValue(MCP_SERVER_ROWS)
122+
// The MCP server lookup awaits select().from(mcpServers).where(...) directly;
123+
// queue a set per lookup so the structural where spy keeps its default wiring.
124+
queueTableRows(schemaMock.mcpServers, MCP_SERVER_ROWS)
124125

125126
// unstubGlobals removes any module-scope fetch stub before each test, so re-stub here
126127
vi.stubGlobal('fetch', mockFetch)

0 commit comments

Comments
 (0)