Files
portainer/app/react/test-utils/withTestQuery.tsx
T
2025-12-17 13:02:19 +02:00

15 lines
432 B
TypeScript

import { ComponentType } from 'react';
import { QueryClient } from '@tanstack/react-query';
import { withReactQuery } from '@CE/react-tools/withReactQuery';
export function withTestQueryProvider<T>(
WrappedComponent: ComponentType<T & JSX.IntrinsicAttributes>
) {
const testQueryClient = new QueryClient({
defaultOptions: { queries: { retry: false } },
});
return withReactQuery(WrappedComponent, testQueryClient);
}