You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/test-utils/withTestQuery.tsx

15 lines
420 B

import { ComponentType } from 'react';
import { QueryClient } from '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);
}