remove default title on ContentHeaderTitle

Signed-off-by: Emma Indal <emma.indahl@gmail.com>
This commit is contained in:
Emma Indal
2024-09-09 14:29:20 +02:00
parent cee34368cb
commit a8bcbe656d
2 changed files with 8 additions and 4 deletions
@@ -30,6 +30,13 @@ describe('<ContentHeader/>', () => {
rendered.getByText('Title');
});
it('should render without title', async () => {
const rendered = await renderInTestApp(
<ContentHeader>content</ContentHeader>,
);
rendered.getByText('content');
});
it('should render with titleComponent', async () => {
const title = 'Custom title';
const titleComponent = <h1>{title}</h1>;
@@ -73,10 +73,7 @@ type ContentHeaderTitleProps = {
className?: string;
};
const ContentHeaderTitle = ({
title = 'Unknown page',
className,
}: ContentHeaderTitleProps) => (
const ContentHeaderTitle = ({ title, className }: ContentHeaderTitleProps) => (
<Typography
variant="h4"
component="h2"