remove usages of @testing-library/react-hooks

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-10-13 00:39:17 +02:00
parent e9318414a0
commit d60fbcb553
94 changed files with 83 additions and 113 deletions
@@ -15,7 +15,7 @@
*/
import React from 'react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useVersionedContext } from '@backstage/version-bridge';
import { AppContext as AppContextV1 } from './types';
import { AppContextProvider } from './AppContext';
@@ -17,7 +17,7 @@
import React, { PropsWithChildren, ReactElement } from 'react';
import { MemoryRouter, Routes } from 'react-router-dom';
import { render } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useVersionedContext } from '@backstage/version-bridge';
import {
childDiscoverer,
@@ -17,7 +17,7 @@
import React, { PropsWithChildren, ReactElement } from 'react';
import { MemoryRouter, Routes, Route, useOutlet } from 'react-router-dom';
import { render } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useVersionedContext } from '@backstage/version-bridge';
import {
childDiscoverer,
-1
View File
@@ -89,7 +89,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"@types/ansi-regex": "^5.0.0",
"@types/classnames": "^2.2.9",
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { act } from 'react-dom/test-utils';
import {
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import React from 'react';
import { fireEvent, waitFor, screen } from '@testing-library/react';
import React, { ComponentType } from 'react';
import { fireEvent, waitFor, screen, renderHook } from '@testing-library/react';
import {
MockAnalyticsApi,
TestApiProvider,
@@ -24,7 +24,6 @@ import {
import { analyticsApiRef, configApiRef } from '@backstage/core-plugin-api';
import { isExternalUri, Link, useResolvedPath } from './Link';
import { Route, Routes } from 'react-router-dom';
import { renderHook, WrapperComponent } from '@testing-library/react-hooks';
import { ConfigReader } from '@backstage/config';
describe('<Link />', () => {
@@ -128,7 +127,7 @@ describe('<Link />', () => {
});
describe('useResolvedPath', () => {
const wrapper: WrapperComponent<React.PropsWithChildren<{}>> = ({
const wrapper: ComponentType<React.PropsWithChildren<{}>> = ({
children,
}) => {
const configApi = new ConfigReader({
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import { applySearchFilter, useLogViewerSearch } from './useLogViewerSearch';
import { AnsiLine } from './AnsiProcessor';
@@ -15,7 +15,7 @@
*/
import React from 'react';
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import { TestApiProvider, MockErrorApi } from '@backstage/test-utils';
import { errorApiRef } from '@backstage/core-plugin-api';
import { AnsiLine } from './AnsiProcessor';
@@ -26,7 +26,7 @@ import HomeIcon from '@material-ui/icons/Home';
import CreateComponentIcon from '@material-ui/icons/AddCircleOutline';
import { Sidebar } from './Bar';
import { SidebarItem, SidebarSearchField, SidebarExpandButton } from './Items';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { makeStyles } from '@material-ui/core/styles';
import { analyticsApiRef } from '@backstage/core-plugin-api';
@@ -16,7 +16,7 @@
import React, { ReactNode, useContext } from 'react';
import { renderWithEffects } from '@backstage/test-utils';
import { waitFor } from '@testing-library/react';
import { renderHook, act } from '@testing-library/react-hooks';
import { renderHook, act } from '@testing-library/react';
import {
LegacySidebarContext,
SidebarOpenStateProvider,
@@ -16,7 +16,7 @@
import React, { ReactNode, useContext } from 'react';
import { renderWithEffects } from '@backstage/test-utils';
import { waitFor } from '@testing-library/react';
import { renderHook, act } from '@testing-library/react-hooks';
import { renderHook, act } from '@testing-library/react';
import {
LegacySidebarPinStateContext,
SidebarPinStateProvider,
-1
View File
@@ -65,7 +65,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0"
},
"files": [
@@ -16,7 +16,7 @@
import React from 'react';
import { render } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { AnalyticsContext, useAnalyticsContext } from './AnalyticsContext';
const AnalyticsSpy = () => {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useAnalytics } from './useAnalytics';
import { useApi } from '../apis';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { createVersionedContextForTesting } from '@backstage/version-bridge';
import { createApiRef } from './ApiRef';
import { useApi } from './useApi';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { createVersionedContextForTesting } from '@backstage/version-bridge';
import { useApp } from './useApp';
@@ -15,7 +15,7 @@
*/
import React, { ReactNode } from 'react';
import { useElementFilter } from './useElementFilter';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { attachComponentData } from './componentData';
import { featureFlagsApiRef } from '../apis';
import { LocalStorageFeatureFlags } from '@backstage/core-app-api';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import React from 'react';
import { MemoryRouter, Router } from 'react-router-dom';
import { createVersionedContextForTesting } from '@backstage/version-bridge';
@@ -20,7 +20,7 @@ import {
TestApiProvider,
withLogCollector,
} from '@backstage/test-utils';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { createTranslationRef, TranslationRef } from './TranslationRef';
import { useTranslationRef } from './useTranslationRef';
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
+1 -2
View File
@@ -43,8 +43,7 @@
"devDependencies": {
"@backstage/cli": "workspace:^",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0"
"@testing-library/react": "^13.4.0"
},
"files": [
"dist"
@@ -15,7 +15,7 @@
*/
import React, { useContext } from 'react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import {
createVersionedContext,
createVersionedContextForTesting,
-1
View File
@@ -60,7 +60,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0"
},
"files": [
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { RELATION_MEMBER_OF } from '@backstage/catalog-model';
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import { useLocation as useLocationMocked } from 'react-router-dom';
import { Direction } from '../EntityRelationsGraph';
import { useCatalogGraphPage } from './useCatalogGraphPage';
@@ -19,7 +19,7 @@ import {
RELATION_OWNER_OF,
RELATION_PART_OF,
} from '@backstage/catalog-model';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { pick } from 'lodash';
import { useEntityRelationGraph } from './useEntityRelationGraph';
import { useEntityStore as useEntityStoreMocked } from './useEntityStore';
@@ -21,7 +21,7 @@ import {
RELATION_PART_OF,
stringifyEntityRef,
} from '@backstage/catalog-model';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { filter, keyBy } from 'lodash';
import { useEntityRelationGraph as useEntityRelationGraphMocked } from './useEntityRelationGraph';
import { useEntityRelationNodesAndEdges } from './useEntityRelationNodesAndEdges';
@@ -16,7 +16,7 @@
import { Entity } from '@backstage/catalog-model';
import { useApi as useApiMocked } from '@backstage/core-plugin-api';
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import { useEntityStore } from './useEntityStore';
jest.mock('@backstage/core-plugin-api');
-1
View File
@@ -68,7 +68,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"msw": "^1.0.0"
},
@@ -19,7 +19,7 @@ import { configApiRef } from '@backstage/core-plugin-api';
import { MockConfigApi, TestApiProvider } from '@backstage/test-utils';
import { makeStyles } from '@material-ui/core';
import { render, screen } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import React from 'react';
import { PreviewCatalogInfoComponent } from './PreviewCatalogInfoComponent';
@@ -16,7 +16,7 @@
import { makeStyles } from '@material-ui/core';
import { render, screen } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import React from 'react';
import { PreviewPullRequestComponent } from './PreviewPullRequestComponent';
@@ -16,7 +16,7 @@
import { Entity, CompoundEntityRef } from '@backstage/catalog-model';
import { cleanup } from '@testing-library/react';
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import { AnalyzeResult } from '../api';
import {
-1
View File
@@ -85,7 +85,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"@types/zen-observable": "^0.8.0",
"react-test-renderer": "^16.13.1"
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useFacetsEntities } from './useFacetsEntities';
import { CatalogApi } from '@backstage/catalog-client';
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { CatalogApi } from '@backstage/catalog-client';
import { useQueryEntities } from './useQueryEntities';
@@ -17,11 +17,7 @@
import { CatalogApi, Location } from '@backstage/catalog-client';
import { Entity, ANNOTATION_ORIGIN_LOCATION } from '@backstage/catalog-model';
import { catalogApiRef } from '../../api';
import {
act,
renderHook,
RenderHookResult,
} from '@testing-library/react-hooks';
import { act, renderHook, RenderHookResult } from '@testing-library/react';
import React, { ReactNode } from 'react';
import {
UseUnregisterEntityDialogState,
@@ -15,7 +15,7 @@
*/
import React, { PropsWithChildren } from 'react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import {
useEntity,
useAsyncEntity,
@@ -25,7 +25,7 @@ import {
storageApiRef,
} from '@backstage/core-plugin-api';
import { MockStorageApi, TestApiProvider } from '@backstage/test-utils';
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import qs from 'qs';
import React, { PropsWithChildren } from 'react';
import { MemoryRouter } from 'react-router-dom';
@@ -18,7 +18,7 @@ import { CatalogApi } from '@backstage/catalog-client';
import { ComponentEntity, RELATION_OWNED_BY } from '@backstage/catalog-model';
import { IdentityApi, identityApiRef } from '@backstage/core-plugin-api';
import { TestApiProvider } from '@backstage/test-utils';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import React from 'react';
import { catalogApiRef } from '../api';
import { useEntityOwnership } from './useEntityOwnership';
@@ -15,7 +15,7 @@
*/
import { catalogEntityDeletePermission } from '@backstage/plugin-catalog-common/alpha';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useEntityPermission } from './useEntityPermission';
import { useAsyncEntity } from './useEntity';
import { usePermission } from '@backstage/plugin-permission-react';
@@ -16,7 +16,7 @@
import { Entity } from '@backstage/catalog-model';
import { TestApiProvider } from '@backstage/test-utils';
import { WrapperComponent, renderHook } from '@testing-library/react-hooks';
import { WrapperComponent, renderHook } from '@testing-library/react';
import React, { PropsWithChildren } from 'react';
import { catalogApiRef } from '../api';
import { useRelatedEntities } from './useRelatedEntities';
@@ -16,7 +16,7 @@
import { Entity } from '@backstage/catalog-model';
import { TestApiProvider } from '@backstage/test-utils';
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import React, { PropsWithChildren } from 'react';
import {
starredEntitiesApiRef,
@@ -16,7 +16,7 @@
import { Entity, CompoundEntityRef } from '@backstage/catalog-model';
import { TestApiProvider } from '@backstage/test-utils';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import React, { PropsWithChildren } from 'react';
import Observable from 'zen-observable';
import { StarredEntitiesApi, starredEntitiesApiRef } from '../apis';
-1
View File
@@ -55,7 +55,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.0.0",
"msw": "^1.0.0"
},
-1
View File
@@ -57,7 +57,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"@types/recharts": "^1.8.15",
"msw": "^1.0.0"
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { renderHook, act } from '@testing-library/react-hooks';
import { renderHook, act } from '@testing-library/react';
import { waitFor } from '@testing-library/react';
import {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { renderHook, act } from '@testing-library/react-hooks';
import { renderHook, act } from '@testing-library/react';
import { waitFor } from '@testing-library/react';
import {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { renderHook, act } from '@testing-library/react-hooks';
import { renderHook, act } from '@testing-library/react';
import { waitFor } from '@testing-library/react';
import {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { renderHook, act } from '@testing-library/react-hooks';
import { renderHook, act } from '@testing-library/react';
import { waitFor } from '@testing-library/react';
import { mockApiClient } from '../test-helpers/mock-api-client';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { renderHook, act } from '@testing-library/react-hooks';
import { renderHook, act } from '@testing-library/react';
import { useResponseSteps } from './useResponseSteps';
@@ -74,7 +74,7 @@ describe('useResponseSteps', () => {
"icon": "failure",
"message": <b>
Something went wrong
<WithStyles(ForwardRef(Typography))
aria-label="fire"
component="span"
@@ -108,7 +108,7 @@ describe('useResponseSteps', () => {
"icon": "failure",
"message": <b>
Something went wrong
<WithStyles(ForwardRef(Typography))
aria-label="fire"
component="span"
-1
View File
@@ -70,7 +70,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.0.0",
"@types/react-grid-layout": "^1.3.2",
"msw": "^1.0.0"
-1
View File
@@ -56,7 +56,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"jest-when": "^3.1.0",
"msw": "^1.0.0"
@@ -15,7 +15,7 @@
*/
import { Entity } from '@backstage/catalog-model';
import { EntityProvider } from '@backstage/plugin-catalog-react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import React, { PropsWithChildren } from 'react';
import { useConsumerGroupsForEntity } from './useConsumerGroupsForEntity';
import { TestApiProvider } from '@backstage/test-utils';
@@ -15,7 +15,7 @@
*/
import { Entity } from '@backstage/catalog-model';
import { EntityProvider } from '@backstage/plugin-catalog-react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { when } from 'jest-when';
import React, { PropsWithChildren } from 'react';
import {
-1
View File
@@ -69,7 +69,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"msw": "^1.0.0"
-1
View File
@@ -56,7 +56,6 @@
"@backstage/test-utils": "workspace:^",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.1",
"jest-websocket-mock": "^2.5.0",
"msw": "^1.3.1"
},
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { useApi } from '@backstage/core-plugin-api';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useEvents } from './useEvents';
import { DateTime } from 'luxon';
@@ -16,7 +16,7 @@
import { useCustomResources } from './useCustomResources';
import { Entity } from '@backstage/catalog-model';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useApi } from '@backstage/core-plugin-api';
import { CustomResourceMatcher } from '@backstage/plugin-kubernetes-common';
import { generateAuth } from './auth';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { useApi } from '@backstage/core-plugin-api';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useIsPodExecTerminalSupported } from './useIsPodExecTerminalSupported';
@@ -16,7 +16,7 @@
import { useKubernetesObjects } from './useKubernetesObjects';
import { Entity } from '@backstage/catalog-model';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useApi } from '@backstage/core-plugin-api';
import { generateAuth } from './auth';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { DetectedErrorsContext, useMatchingErrors } from './useMatchingErrors';
import {
DetectedError,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { PodMetricsContext, usePodMetrics } from './usePodMetrics';
import { ClientPodStatus } from '@backstage/plugin-kubernetes-common';
-1
View File
@@ -74,7 +74,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"jest-websocket-mock": "^2.4.1",
"msw": "^1.0.0"
-1
View File
@@ -60,7 +60,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"msw": "^1.0.0"
},
@@ -15,7 +15,7 @@
*/
import { Entity } from '@backstage/catalog-model';
import { EntityProvider } from '@backstage/plugin-catalog-react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import React, { PropsWithChildren } from 'react';
import { WebsiteListResponse } from '@backstage/plugin-lighthouse-common';
import { lighthouseApiRef } from '../api';
-1
View File
@@ -62,7 +62,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.0.0",
"msw": "^1.0.0"
},
@@ -16,7 +16,7 @@
import { CompoundEntityRef, Entity } from '@backstage/catalog-model';
import { useGetEntities } from './useGetEntities';
import { CatalogApi } from '@backstage/catalog-client';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { getEntityRelations } from '@backstage/plugin-catalog-react';
const givenParentGroup = 'team.squad1';
-1
View File
@@ -64,7 +64,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"msw": "^1.0.0",
"swr": "^2.0.0"
@@ -22,8 +22,7 @@ import {
} from '@backstage/plugin-permission-react';
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { Button } from '@material-ui/core';
import { fireEvent, waitFor } from '@testing-library/react';
import { act } from '@testing-library/react-hooks';
import { fireEvent, waitFor, act } from '@testing-library/react';
import React from 'react';
import { SWRConfig } from 'swr';
import { PlaylistApi, playlistApiRef } from '../../api';
@@ -24,8 +24,7 @@ import {
permissionApiRef,
} from '@backstage/plugin-permission-react';
import { Button } from '@material-ui/core';
import { fireEvent, getByRole, waitFor } from '@testing-library/react';
import { act } from '@testing-library/react-hooks';
import { fireEvent, getByRole, waitFor, act } from '@testing-library/react';
import React from 'react';
import { SWRConfig } from 'swr';
import { PlaylistApi, playlistApiRef } from '../../api';
@@ -16,8 +16,7 @@
import { IdentityApi, identityApiRef } from '@backstage/core-plugin-api';
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { fireEvent, getByRole, waitFor } from '@testing-library/react';
import { act } from '@testing-library/react-hooks';
import { fireEvent, getByRole, waitFor, act } from '@testing-library/react';
import { PlaylistApi, playlistApiRef } from '../../api';
import React from 'react';
@@ -21,8 +21,7 @@ import {
} from '@backstage/plugin-catalog-react';
import { SearchApi, searchApiRef } from '@backstage/plugin-search-react';
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { fireEvent, getByText } from '@testing-library/react';
import { act } from '@testing-library/react-hooks';
import { fireEvent, getByText, act } from '@testing-library/react';
import React from 'react';
import { AddEntitiesDrawer } from './AddEntitiesDrawer';
@@ -23,8 +23,7 @@ import {
} from '@backstage/plugin-permission-react';
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { Button } from '@material-ui/core';
import { fireEvent, waitFor } from '@testing-library/react';
import { act } from '@testing-library/react-hooks';
import { fireEvent, waitFor, act } from '@testing-library/react';
import React from 'react';
import { SWRConfig } from 'swr';
import { PlaylistApi, playlistApiRef } from '../../api';
@@ -27,8 +27,7 @@ import {
import { permissions, Playlist } from '@backstage/plugin-playlist-common';
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { Button } from '@material-ui/core';
import { fireEvent, waitFor } from '@testing-library/react';
import { act } from '@testing-library/react-hooks';
import { fireEvent, waitFor, act } from '@testing-library/react';
import React from 'react';
import { SWRConfig } from 'swr';
import { PlaylistApi, playlistApiRef } from '../../api';
@@ -21,8 +21,7 @@ import {
permissionApiRef,
} from '@backstage/plugin-permission-react';
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { fireEvent, getByText, waitFor } from '@testing-library/react';
import { act } from '@testing-library/react-hooks';
import { fireEvent, getByText, waitFor, act } from '@testing-library/react';
import React from 'react';
import { SWRConfig } from 'swr';
@@ -14,8 +14,13 @@
* limitations under the License.
*/
import { fireEvent, getByRole, render, waitFor } from '@testing-library/react';
import { act } from '@testing-library/react-hooks';
import {
fireEvent,
getByRole,
render,
waitFor,
act,
} from '@testing-library/react';
import React from 'react';
import { MockPlaylistListProvider } from '../../testUtils';
@@ -22,7 +22,7 @@ import {
} from '@backstage/core-plugin-api';
import { Playlist } from '@backstage/plugin-playlist-common';
import { TestApiProvider } from '@backstage/test-utils';
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import qs from 'qs';
import React, { PropsWithChildren } from 'react';
import { MemoryRouter } from 'react-router-dom';
-1
View File
@@ -60,7 +60,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
-1
View File
@@ -94,7 +94,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"@types/humanize-duration": "^3.18.1",
"@types/luxon": "^3.0.0"
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { useTemplateSchema } from './useTemplateSchema';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { TestApiProvider } from '@backstage/test-utils';
import React from 'react';
import { featureFlagsApiRef } from '@backstage/core-plugin-api';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { PropsWithChildren } from 'react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { TestApiProvider } from '@backstage/test-utils';
import { type ParsedTemplateSchema } from './useTemplateSchema';
import { useTransformSchemaToProps } from './useTransformSchemaToProps';
@@ -15,7 +15,7 @@
*/
import React from 'react';
import { useTemplateSecrets, SecretsContextProvider } from './SecretsContext';
import { renderHook, act } from '@testing-library/react-hooks';
import { renderHook, act } from '@testing-library/react';
describe('SecretsContext', () => {
it('should allow the setting of secrets in the context', async () => {
-1
View File
@@ -105,7 +105,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"@types/humanize-duration": "^3.18.1",
"@types/json-schema": "^7.0.9",
-1
View File
@@ -73,7 +73,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0"
},
"files": [
@@ -16,7 +16,7 @@
import React from 'react';
import { ApiProvider } from '@backstage/core-app-api';
import { MockConfigApi, TestApiRegistry } from '@backstage/test-utils';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { searchApiRef } from '../../api';
import { SearchContextProvider, useSearch } from '../../context';
@@ -16,7 +16,7 @@
import { configApiRef } from '@backstage/core-plugin-api';
import { render, screen, waitFor } from '@testing-library/react';
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import { MockConfigApi, TestApiProvider } from '@backstage/test-utils';
import React from 'react';
import {
-1
View File
@@ -78,7 +78,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"history": "^5.0.0",
"msw": "^1.0.0"
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import { useSearchModal } from './useSearchModal';
import { BrowserRouter, Router } from 'react-router-dom';
import { createMemoryHistory } from 'history';
+1 -2
View File
@@ -58,8 +58,7 @@
"@backstage/test-utils": "workspace:^",
"@backstage/theme": "workspace:^",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0"
"@testing-library/react": "^13.4.0"
},
"files": [
"alpha",
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
import { renderHook, act } from '@testing-library/react-hooks';
import { renderHook, act } from '@testing-library/react';
import { ThemeProvider } from '@material-ui/core';
+1 -1
View File
@@ -19,7 +19,7 @@ import {
useShadowRootElements,
useShadowRootSelection,
} from './hooks';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { fireEvent, waitFor } from '@testing-library/react';
const fireSelectionChangeEvent = (window: Window) => {
-1
View File
@@ -87,7 +87,6 @@
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
"@types/dompurify": "^2.2.2",
"@types/event-source-polyfill": "^1.0.0",
@@ -15,7 +15,7 @@
*/
import React from 'react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { ThemeProvider } from '@material-ui/core';
@@ -16,7 +16,7 @@
import { NotFoundError } from '@backstage/errors';
import { TestApiProvider } from '@backstage/test-utils';
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import React from 'react';
import { techdocsStorageApiRef } from '../../api';
import {
@@ -15,7 +15,7 @@
*/
import React, { FC, PropsWithChildren } from 'react';
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { ConfigReader } from '@backstage/core-app-api';
import { ConfigApi, configApiRef } from '@backstage/core-plugin-api';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useStylesTransformer } from './transformer';
describe('Transformers > Styles', () => {