MCPcopy
hub / github.com/OpenHands/OpenHands / renderWithProviders

Function renderWithProviders

frontend/test-utils.tsx:65–83  ·  view source on GitHub ↗
(
  ui: React.ReactElement,
  renderOptions: ExtendedRenderOptions = {},
)

Source from the content-addressed store, hash-verified

63// Export our own customized renderWithProviders function that renders with QueryClient and i18next providers
64// Since we're using Zustand stores, we don't need a Redux Provider wrapper
65export function renderWithProviders(
66 ui: React.ReactElement,
67 renderOptions: ExtendedRenderOptions = {},
68) {
69 function Wrapper({ children }: PropsWithChildren) {
70 return (
71 <QueryClientProvider
72 client={
73 new QueryClient({
74 defaultOptions: { queries: { retry: false } },
75 })
76 }
77 >
78 <I18nextProvider i18n={i18n}>{children}</I18nextProvider>
79 </QueryClientProvider>
80 );
81 }
82 return render(ui, { wrapper: Wrapper, ...renderOptions });
83}
84
85export const createAxiosNotFoundErrorObject = () =>
86 new AxiosError(

Calls

no outgoing calls

Tested by 14

renderWithRouterFunction · 0.72
renderInteractiveChatBoxFunction · 0.72
renderTerminalFunction · 0.72
renderChatInterfaceFunction · 0.72
renderPaymentFormFunction · 0.72
renderPlanPreviewFunction · 0.72
renderSidebarFunction · 0.72
renderModalFunction · 0.72
renderRecentConversationFunction · 0.72