Skip to content

Commit b5a93fe

Browse files
committed
test(webview-ui): wrap ChatRow tests with QueryClientProvider to fix 'No QueryClient set' error
1 parent 1734b67 commit b5a93fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

webview-ui/src/components/chat/__tests__/ChatRow.spec.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
// npx vitest run src/components/chat/__tests__/ChatRow.spec.tsx
22

3-
import { render, screen, fireEvent, waitFor } from "@testing-library/react"
3+
import { render as rtlRender, screen, fireEvent, waitFor } from "@testing-library/react"
4+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
45
import { describe, it, expect, vi, beforeEach } from "vitest"
56
import { ChatRowContent } from "../ChatRow"
67
import type { ClineMessage } from "@roo-code/types"
78

9+
const render = (ui: any) => rtlRender(<QueryClientProvider client={new QueryClient()}>{ui}</QueryClientProvider>)
10+
811
// Mock the clipboard utility
912
const mockCopyWithFeedback = vi.fn().mockResolvedValue(true)
1013
vi.mock("@src/utils/clipboard", () => ({

0 commit comments

Comments
 (0)