diff --git a/plugins/explore/src/components/DomainCard/DomainCard.test.tsx b/plugins/explore/src/components/DomainCard/DomainCard.test.tsx
index df9b84820a..cb0fd8b473 100644
--- a/plugins/explore/src/components/DomainCard/DomainCard.test.tsx
+++ b/plugins/explore/src/components/DomainCard/DomainCard.test.tsx
@@ -51,4 +51,31 @@ describe('', () => {
'/catalog/default/domain/artists',
);
});
+
+ it('renders a domain card with custom title', async () => {
+ const entity: DomainEntity = {
+ apiVersion: 'backstage.io/v1alpha1',
+ kind: 'Domain',
+ metadata: {
+ name: 'artists',
+ },
+ spec: {
+ owner: 'guest',
+ },
+ };
+ const { getByText } = await renderInTestApp(
+ ,
+ {
+ mountedRoutes: {
+ '/catalog/:namespace/:kind/:name': entityRouteRef,
+ },
+ },
+ );
+
+ expect(getByText('Explore').parentElement).toHaveAttribute(
+ 'href',
+ '/catalog/default/domain/artists',
+ );
+ expect(getByText('my Custom Title')).toBeInTheDocument();
+ });
});
diff --git a/plugins/explore/src/components/DomainCard/DomainCard.tsx b/plugins/explore/src/components/DomainCard/DomainCard.tsx
index 0d37e3e273..f5327ea4e0 100644
--- a/plugins/explore/src/components/DomainCard/DomainCard.tsx
+++ b/plugins/explore/src/components/DomainCard/DomainCard.tsx
@@ -35,7 +35,7 @@ import { LinkButton, ItemCardHeader } from '@backstage/core-components';
import { useRouteRef } from '@backstage/core-plugin-api';
/** @public */
-export const DomainCard = (props: { entity: DomainEntity }) => {
+export const DomainCard = (props: { entity: DomainEntity; title?: string }) => {
const { entity } = props;
const catalogEntityRoute = useRouteRef(entityRouteRef);
@@ -53,7 +53,10 @@ export const DomainCard = (props: { entity: DomainEntity }) => {
return (
-
+
{entity.metadata.tags?.length ? (