fix: stabilize useQuery mock reference to prevent infinite re-render loop in AgentOutputViewer test
This commit is contained in:
@@ -5,10 +5,11 @@ import { vi, describe, it, expect, beforeEach } from 'vitest'
|
|||||||
import * as parseModule from '@/lib/parse-agent-output'
|
import * as parseModule from '@/lib/parse-agent-output'
|
||||||
import { AgentOutputViewer } from './AgentOutputViewer'
|
import { AgentOutputViewer } from './AgentOutputViewer'
|
||||||
|
|
||||||
|
const EMPTY_CHUNKS: never[] = []
|
||||||
vi.mock('@/lib/trpc', () => ({
|
vi.mock('@/lib/trpc', () => ({
|
||||||
trpc: {
|
trpc: {
|
||||||
getAgentOutput: {
|
getAgentOutput: {
|
||||||
useQuery: vi.fn(() => ({ data: [], isLoading: false })),
|
useQuery: vi.fn(() => ({ data: EMPTY_CHUNKS, isLoading: false })),
|
||||||
},
|
},
|
||||||
onAgentOutput: {
|
onAgentOutput: {
|
||||||
useSubscription: vi.fn(),
|
useSubscription: vi.fn(),
|
||||||
|
|||||||
Reference in New Issue
Block a user