diff --git a/plugins/techdocs-module-addons-contrib/src/ExpandableNavigation/ExpandableNavigation.test.tsx b/plugins/techdocs-module-addons-contrib/src/ExpandableNavigation/ExpandableNavigation.test.tsx
index 3efc923145..a38ea600bc 100644
--- a/plugins/techdocs-module-addons-contrib/src/ExpandableNavigation/ExpandableNavigation.test.tsx
+++ b/plugins/techdocs-module-addons-contrib/src/ExpandableNavigation/ExpandableNavigation.test.tsx
@@ -20,6 +20,7 @@ import React from 'react';
import { fireEvent, waitFor } from '@testing-library/react';
import { ExpandableNavigation } from '../plugin';
+import { entityPresentationApiRef } from '@backstage/plugin-catalog-react';
const mockNavWithSublevels = (
@@ -84,11 +85,21 @@ const mockNavWithoutSublevels = (
);
describe('ExpandableNavigation', () => {
+ const entityPresentationApiMock = {
+ forEntity: jest.fn(),
+ };
+ entityPresentationApiMock.forEntity.mockReturnValue({
+ snapshot: {
+ primaryTitle: 'Test Entity',
+ },
+ });
+
it('renders without exploding', async () => {
const { getByRole } = await TechDocsAddonTester.buildAddonsInTechDocs([
,
])
.withDom(mockNavWithSublevels)
+ .withApis([[entityPresentationApiRef, entityPresentationApiMock]])
.renderWithEffects();
expect(getByRole('button', { name: 'expand-nav' })).toBeInTheDocument();
@@ -100,6 +111,7 @@ describe('ExpandableNavigation', () => {
,
])
.withDom(mockNavWithSublevels)
+ .withApis([[entityPresentationApiRef, entityPresentationApiMock]])
.renderWithEffects();
const toggles =
@@ -137,6 +149,7 @@ describe('ExpandableNavigation', () => {
,
])
.withDom(mockNavWithoutSublevels)
+ .withApis([[entityPresentationApiRef, entityPresentationApiMock]])
.renderWithEffects();
expect(
diff --git a/plugins/techdocs-module-addons-contrib/src/ReportIssue/ReportIssue.test.tsx b/plugins/techdocs-module-addons-contrib/src/ReportIssue/ReportIssue.test.tsx
index 459fa1b65e..d7dd6584c1 100644
--- a/plugins/techdocs-module-addons-contrib/src/ReportIssue/ReportIssue.test.tsx
+++ b/plugins/techdocs-module-addons-contrib/src/ReportIssue/ReportIssue.test.tsx
@@ -21,6 +21,7 @@ import { fireEvent, waitFor } from '@testing-library/react';
import { scmIntegrationsApiRef } from '@backstage/integration-react';
import { ReportIssue } from '../plugin';
+import { entityPresentationApiRef } from '@backstage/plugin-catalog-react';
const byUrl = jest.fn();
@@ -52,6 +53,15 @@ describe('ReportIssue', () => {
containsNode: () => true,
} as unknown as Selection;
+ const entityPresentationApiMock = {
+ forEntity: jest.fn(),
+ };
+ entityPresentationApiMock.forEntity.mockReturnValue({
+ snapshot: {
+ primaryTitle: 'Test Entity',
+ },
+ });
+
beforeEach(() => {
jest.clearAllMocks();
});
@@ -93,7 +103,10 @@ describe('ReportIssue', () => {