From 2cb6f1ab813b42483f989d560f0c5f9ee3bd312b Mon Sep 17 00:00:00 2001 From: nicholas-codecov Date: Wed, 11 Dec 2024 16:54:19 -0500 Subject: [PATCH] update usage in EnterpriseLandingPage --- .../EnterpriseLandingPage.test.tsx | 28 +++++++++++++------ .../EnterpriseLandingPage.tsx | 6 ++-- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/pages/EnterpriseLandingPage/EnterpriseLandingPage.test.tsx b/src/pages/EnterpriseLandingPage/EnterpriseLandingPage.test.tsx index d07a0d0271..80d2626954 100644 --- a/src/pages/EnterpriseLandingPage/EnterpriseLandingPage.test.tsx +++ b/src/pages/EnterpriseLandingPage/EnterpriseLandingPage.test.tsx @@ -1,4 +1,8 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query' +import { + QueryClientProvider as QueryClientProviderV5, + QueryClient as QueryClientV5, +} from '@tanstack/react-queryV5' import { render, screen } from '@testing-library/react' import { graphql, HttpResponse } from 'msw' import { setupServer } from 'msw/node' @@ -11,16 +15,23 @@ import EnterpriseLandingPage from './EnterpriseLandingPage' vi.mock('config') const server = setupServer() -const queryClient = new QueryClient() +const queryClient = new QueryClient({ + defaultOptions: { queries: { retry: false } }, +}) +const queryClientV5 = new QueryClientV5({ + defaultOptions: { queries: { retry: false } }, +}) const wrapper: React.FC = ({ children }) => ( - - - - {children} - - - + + + + + {children} + + + + ) const mockServiceProviders = { @@ -43,6 +54,7 @@ beforeAll(() => { afterEach(() => { queryClient.clear() + queryClientV5.clear() server.resetHandlers() }) diff --git a/src/pages/EnterpriseLandingPage/EnterpriseLandingPage.tsx b/src/pages/EnterpriseLandingPage/EnterpriseLandingPage.tsx index 0707762527..a889e74ad6 100644 --- a/src/pages/EnterpriseLandingPage/EnterpriseLandingPage.tsx +++ b/src/pages/EnterpriseLandingPage/EnterpriseLandingPage.tsx @@ -1,5 +1,7 @@ +import { useSuspenseQuery as useSuspenseQueryV5 } from '@tanstack/react-queryV5' + import rocketImg from 'assets/enterprise-rocket.png' -import { useLoginProviders } from 'services/config/useLoginProviders' +import { LoginProvidersQueryOpts } from 'services/config/LoginProvidersQueryOpts' import { LoginProvidersEnum } from 'shared/utils/loginProviders' import ProviderCard from './ProviderCard/ProviderCard' @@ -8,7 +10,7 @@ import { useEnterpriseRedirect } from './useEnterpriseRedirect' function EnterpriseLandingPage() { useEnterpriseRedirect() - const { data } = useLoginProviders() + const { data } = useSuspenseQueryV5(LoginProvidersQueryOpts()) return (