From 18f8ff410abeac34d19a77a7d0a94c8ecc65a6a2 Mon Sep 17 00:00:00 2001 From: Yingbai He Date: Fri, 15 Nov 2024 16:49:09 -0700 Subject: [PATCH] feat(TechDocs): update to support the new component Signed-off-by: Yingbai He --- .../src/home/components/TechDocsCustomHome.test.tsx | 11 +++++++++-- .../src/home/components/TechDocsCustomHome.tsx | 5 ++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/plugins/techdocs/src/home/components/TechDocsCustomHome.test.tsx b/plugins/techdocs/src/home/components/TechDocsCustomHome.test.tsx index 409d68a593..585248c6c9 100644 --- a/plugins/techdocs/src/home/components/TechDocsCustomHome.test.tsx +++ b/plugins/techdocs/src/home/components/TechDocsCustomHome.test.tsx @@ -14,7 +14,11 @@ * limitations under the License. */ -import { catalogApiRef } from '@backstage/plugin-catalog-react'; +import { + catalogApiRef, + starredEntitiesApiRef, + MockStarredEntitiesApi, +} from '@backstage/plugin-catalog-react'; import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; import { renderInTestApp, TestApiRegistry } from '@backstage/test-utils'; import { screen } from '@testing-library/react'; @@ -37,7 +41,10 @@ const mockCatalogApi = catalogApiMock({ }); describe('TechDocsCustomHome', () => { - const apiRegistry = TestApiRegistry.from([catalogApiRef, mockCatalogApi]); + const apiRegistry = TestApiRegistry.from( + [catalogApiRef, mockCatalogApi], + [starredEntitiesApiRef, new MockStarredEntitiesApi()], + ); it('should render a TechDocs home page', async () => { const tabsConfig = [ diff --git a/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx b/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx index 56d086acfc..d89bc5ee1b 100644 --- a/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx +++ b/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx @@ -23,6 +23,7 @@ import { catalogApiRef, CatalogApi, useEntityOwnership, + EntityListProvider, } from '@backstage/plugin-catalog-react'; import { Entity } from '@backstage/catalog-model'; import { DocsTable } from './Tables'; @@ -127,7 +128,9 @@ const CustomPanel = ({ ) : null}
- + + +
);