diff --git a/plugins/scaffolder-react/src/next/components/TemplateGroup/TemplateGroup.test.tsx b/plugins/scaffolder-react/src/next/components/TemplateGroup/TemplateGroup.test.tsx
index 02756839c9..8d8ae718dc 100644
--- a/plugins/scaffolder-react/src/next/components/TemplateGroup/TemplateGroup.test.tsx
+++ b/plugins/scaffolder-react/src/next/components/TemplateGroup/TemplateGroup.test.tsx
@@ -22,16 +22,6 @@ import { TemplateCard } from '../TemplateCard';
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
describe('TemplateGroup', () => {
- it('should return a message when no templates are passed in', async () => {
- const { getByText } = render(
- ,
- );
-
- expect(
- getByText(/No templates found that match your filter/),
- ).toBeInTheDocument();
- });
-
it('should render a card for each template with the template being passed as a prop', () => {
const mockOnSelected = jest.fn();
const mockTemplates: { template: TemplateEntityV1beta3 }[] = [
@@ -130,14 +120,6 @@ describe('TemplateGroup', () => {
);
}
});
-
- it('should render the title when no templates passed', () => {
- const { getByText } = render(
- ,
- );
- expect(getByText('Test')).toBeInTheDocument();
- });
-
it('should render the title when there are templates in the list', () => {
const mockTemplates: { template: TemplateEntityV1beta3 }[] = [
{
@@ -163,10 +145,20 @@ describe('TemplateGroup', () => {
it('should allow for passing through a user given title component', () => {
const TitleComponent =
Im a custom header
;
+ const mockTemplates: { template: TemplateEntityV1beta3 }[] = [
+ {
+ template: {
+ apiVersion: 'scaffolder.backstage.io/v1beta3',
+ kind: 'Template',
+ metadata: { name: 'test' },
+ spec: { parameters: [], steps: [], type: 'website' },
+ },
+ },
+ ];
const { getByText } = render(
,
);
diff --git a/plugins/scaffolder-react/src/next/components/TemplateGroup/TemplateGroup.tsx b/plugins/scaffolder-react/src/next/components/TemplateGroup/TemplateGroup.tsx
index 8134ea256d..03f866922b 100644
--- a/plugins/scaffolder-react/src/next/components/TemplateGroup/TemplateGroup.tsx
+++ b/plugins/scaffolder-react/src/next/components/TemplateGroup/TemplateGroup.tsx
@@ -61,18 +61,7 @@ export const TemplateGroup = (props: TemplateGroupProps) => {
typeof title === 'string' ? : title;
if (templates.length === 0) {
- return (
-
- {titleComponent}
-
- No templates found that match your filter. Learn more about{' '}
-
- adding templates
-
- .
-
-
- );
+ return null;
}
const Card = CardComponent || TemplateCard;