1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 21:39:40 +02:00
portainer/app/react/test-utils/withTestQuery.tsx

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
430 B
TypeScript
Raw Normal View History

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