diff --git a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx
index ab3092e3ed..2522283230 100644
--- a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx
+++ b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx
@@ -28,6 +28,13 @@ import { EntityPickerProps } from './schema';
import { ScaffolderRJSFFieldProps as FieldProps } from '@backstage/plugin-scaffolder-react';
import { DefaultEntityPresentationApi } from '@backstage/plugin-catalog';
import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils';
+import * as backstageCore from '@backstage/core-components';
+
+// Mock MarkdownContent to test that it's called with the right props
+jest.mock('@backstage/core-components', () => ({
+ ...jest.requireActual('@backstage/core-components'),
+ MarkdownContent: jest.fn(() => null),
+}));
const makeEntity = (kind: string, namespace: string, name: string): Entity => ({
apiVersion: 'scaffolder.backstage.io/v1beta3',
@@ -812,4 +819,39 @@ describe('', () => {
expect(onChange).toHaveBeenCalledWith(undefined);
});
});
+
+ describe('with markdown description', () => {
+ beforeEach(() => {
+ jest.clearAllMocks();
+ uiSchema = { 'ui:options': {} };
+ props = {
+ onChange,
+ schema: {
+ description: '**Bold text** and *italic text*',
+ },
+ required,
+ uiSchema,
+ rawErrors,
+ formData,
+ } as unknown as FieldProps;
+
+ catalogApi.getEntities.mockResolvedValue({ items: entities });
+ });
+
+ it('renders description as markdown', async () => {
+ await renderInTestApp(
+
+
+ ,
+ );
+
+ expect(backstageCore.MarkdownContent).toHaveBeenCalledWith(
+ expect.objectContaining({
+ content: '**Bold text** and *italic text*',
+ linkTarget: '_blank',
+ }),
+ expect.anything(),
+ );
+ });
+ });
});