(
ui: React.ReactElement,
renderOptions: ExtendedRenderOptions = {},
)
| 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 |
| 65 | export 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 | |
| 85 | export const createAxiosNotFoundErrorObject = () => |
| 86 | new AxiosError( |
no outgoing calls