From def6247bb6cc42437a77c5c9bbb3b303fa195d02 Mon Sep 17 00:00:00 2001 From: Owen Shartle Date: Mon, 25 Aug 2025 22:00:22 -0400 Subject: [PATCH] Adding catalogApiRef to test-utils.tsx. Signed-off-by: Owen Shartle --- plugins/techdocs-addons-test-utils/src/test-utils.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/techdocs-addons-test-utils/src/test-utils.tsx b/plugins/techdocs-addons-test-utils/src/test-utils.tsx index 91b85e7885..2d7420ec62 100644 --- a/plugins/techdocs-addons-test-utils/src/test-utils.tsx +++ b/plugins/techdocs-addons-test-utils/src/test-utils.tsx @@ -39,6 +39,7 @@ import { } from '@backstage/plugin-techdocs-react'; import { TechDocsReaderPage, techdocsPlugin } from '@backstage/plugin-techdocs'; import { + catalogApiRef, EntityPresentationApi, entityPresentationApiRef, entityRouteRef, @@ -235,8 +236,16 @@ export class TechDocsAddonTester { }), }; + const catalogApi = { + getEntityByRef: jest.fn().mockResolvedValue({ + kind: 'Component', + metadata: { namespace: 'default', name: 'docs' }, + }), + }; + const apis: TechdocsAddonTesterApis = [ [fetchApiRef, fetchApi], + [catalogApiRef, catalogApi], [entityPresentationApiRef, entityPresentationApi], [discoveryApiRef, discoveryApi], [techdocsApiRef, techdocsApi],