test(webview-ui): wrap ChatRow tests with QueryClientProvider to fix 'No QueryClient set' error

This commit is contained in:
Hannes Rudolph 2025-09-05 17:14:13 -06:00
parent 1734b67b05
commit b5a93fe11d

View file

@ -1,10 +1,13 @@
// npx vitest run src/components/chat/__tests__/ChatRow.spec.tsx
import { render, screen, fireEvent, waitFor } from "@testing-library/react"
import { render as rtlRender, screen, fireEvent, waitFor } from "@testing-library/react"
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { describe, it, expect, vi, beforeEach } from "vitest"
import { ChatRowContent } from "../ChatRow"
import type { ClineMessage } from "@roo-code/types"
const render = (ui: any) => rtlRender(<QueryClientProvider client={new QueryClient()}>{ui}</QueryClientProvider>)
// Mock the clipboard utility
const mockCopyWithFeedback = vi.fn().mockResolvedValue(true)
vi.mock("@src/utils/clipboard", () => ({