diff --git a/src/pages/RepoPage/ConfigTab/tabs/ConfigurationManager/ConfigurationManager.test.tsx b/src/pages/RepoPage/ConfigTab/tabs/ConfigurationManager/ConfigurationManager.test.tsx index 209aac36e7..227005791d 100644 --- a/src/pages/RepoPage/ConfigTab/tabs/ConfigurationManager/ConfigurationManager.test.tsx +++ b/src/pages/RepoPage/ConfigTab/tabs/ConfigurationManager/ConfigurationManager.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, waitFor } from '@testing-library/react' import { graphql, HttpResponse } from 'msw' import { setupServer } from 'msw/node' @@ -7,7 +11,7 @@ import { MemoryRouter, Route } from 'react-router' import { TierNames, TTierNames } from 'services/tier' import ConfigurationManager from './ConfigurationManager' -import { RepositoryConfiguration } from './hooks/useRepoConfigurationStatus/useRepoConfigurationStatus' +import { RepositoryConfiguration } from './hooks/useRepoConfigurationStatus/RepoConfigurationStatusQueryOpts' interface mockRepoConfigArgs { tierName?: TTierNames @@ -52,19 +56,20 @@ function mockRepoConfig({ } const queryClient = new QueryClient({ - defaultOptions: { - queries: { - retry: false, - }, - }, + defaultOptions: { queries: { retry: false } }, +}) +const queryClientV5 = new QueryClientV5({ + defaultOptions: { queries: { retry: false } }, }) const server = setupServer() const wrapper: React.FC = ({ children }) => ( - - - {children} - - + + + + {children} + + + ) beforeAll(() => { @@ -72,6 +77,7 @@ beforeAll(() => { }) afterEach(() => { queryClient.clear() + queryClientV5.clear() server.resetHandlers() }) afterAll(() => { diff --git a/src/pages/RepoPage/ConfigTab/tabs/ConfigurationManager/ConfigurationManager.tsx b/src/pages/RepoPage/ConfigTab/tabs/ConfigurationManager/ConfigurationManager.tsx index b5969e35e7..db15317422 100644 --- a/src/pages/RepoPage/ConfigTab/tabs/ConfigurationManager/ConfigurationManager.tsx +++ b/src/pages/RepoPage/ConfigTab/tabs/ConfigurationManager/ConfigurationManager.tsx @@ -1,3 +1,4 @@ +import { useSuspenseQuery as useSuspenseQueryV5 } from '@tanstack/react-queryV5' import { useParams } from 'react-router' import { TierNames } from 'services/tier' @@ -5,9 +6,9 @@ import { TierNames } from 'services/tier' import FeatureGroup from './components/FeatureGroup' import FeatureItem from './components/FeatureItem/FeatureItem' import { + RepoConfigurationStatusQueryOpts, RepositoryConfiguration, - useRepoConfigurationStatus, -} from './hooks/useRepoConfigurationStatus/useRepoConfigurationStatus' +} from './hooks/useRepoConfigurationStatus/RepoConfigurationStatusQueryOpts' interface URLParams { provider: string @@ -17,11 +18,13 @@ interface URLParams { function ConfigurationManager() { const { provider, owner, repo } = useParams() - const { data: repoConfiguration } = useRepoConfigurationStatus({ - provider, - owner, - repo, - }) + const { data: repoConfiguration } = useSuspenseQueryV5( + RepoConfigurationStatusQueryOpts({ + provider, + owner, + repo, + }) + ) return (