diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx index 4bf6d2007a..eab3606f77 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx @@ -19,6 +19,7 @@ import { CatalogApi, catalogApiRef, EntityProvider, + catalogRouteRef, } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { queryByText } from '@testing-library/react'; @@ -123,6 +124,11 @@ describe('OwnershipCard', () => { , + { + mountedRoutes: { + '/create': catalogRouteRef, + }, + }, ); expect(getByText('OPENAPI')).toBeInTheDocument(); diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx index 2c7e1db2eb..00e20bb709 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx @@ -19,6 +19,7 @@ import { catalogApiRef, isOwnerOf, useEntity, + catalogRouteRef, } from '@backstage/plugin-catalog-react'; import { BackstageTheme, genPageTheme } from '@backstage/theme'; import { @@ -39,7 +40,7 @@ import { Progress, ResponseErrorPanel, } from '@backstage/core-components'; -import { useApi } from '@backstage/core-plugin-api'; +import { useApi, useRouteRef } from '@backstage/core-plugin-api'; type EntityTypeProps = { name: string; @@ -93,10 +94,11 @@ const EntityCountTile = ({ queryParams: string; }) => { const classes = useStyles({ type }); + const catalogLink = useRouteRef(catalogRouteRef); return (