Merge pull request #18181 from backstage/fix-heading-accessibility

Fix <SidebarItem/> and <ToolsCard/> heading accessibility
This commit is contained in:
Johan Haals
2023-06-12 10:37:36 +02:00
committed by GitHub
7 changed files with 44 additions and 10 deletions
@@ -36,8 +36,12 @@ describe('<ToolCard />', () => {
});
it('renders props correctly', () => {
const { getByText } = render(wrapInTestApp(<ToolCard {...minProps} />));
expect(getByText(minProps.card.title)).toBeInTheDocument();
const { getByRole, getByText } = render(
wrapInTestApp(<ToolCard {...minProps} />),
);
expect(
getByRole('heading', { name: minProps.card.title }),
).toBeInTheDocument();
expect(getByText(minProps.card.description)).toBeInTheDocument();
});
@@ -74,7 +74,7 @@ export const ToolCard = ({ card, objectFit }: Props) => {
})}
/>
<CardContent>
<Typography paragraph variant="h5">
<Typography variant="h5">
{title}{' '}
{lifecycle && lifecycle.toLocaleLowerCase('en-US') !== 'ga' && (
<Chip