Roo-Code/webview-ui/src/utils/test-utils.tsx
Hannes Rudolph 3318366b66
fix: standardize tooltip delays to 300ms (#5090) (#5098)
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-26 15:41:32 -04:00

21 lines
717 B
TypeScript

import React from "react"
import { render, RenderOptions } from "@testing-library/react"
import { TooltipProvider } from "@/components/ui/tooltip"
import { STANDARD_TOOLTIP_DELAY } from "@/components/ui/standard-tooltip"
interface AllTheProvidersProps {
children: React.ReactNode
}
const AllTheProviders = ({ children }: AllTheProvidersProps) => {
return <TooltipProvider delayDuration={STANDARD_TOOLTIP_DELAY}>{children}</TooltipProvider>
}
const customRender = (ui: React.ReactElement, options?: Omit<RenderOptions, "wrapper">) =>
render(ui, { wrapper: AllTheProviders, ...options })
// re-export everything
export * from "@testing-library/react"
// override render method
export { customRender as render }