diff --git a/src/lib/components/iconhelper/IconHelper.test.tsx b/src/lib/components/iconhelper/IconHelper.test.tsx index b29c570232..6674ad3c12 100644 --- a/src/lib/components/iconhelper/IconHelper.test.tsx +++ b/src/lib/components/iconhelper/IconHelper.test.tsx @@ -35,4 +35,18 @@ describe('Icon', () => { expect(screen.getByText(tooltipMessage)).toBeVisible(); }); }); + it('should be able to change accessible label with title', async () => { + const { Wrapper } = getWrapper(); + render( + + + , + ); + await waitFor(() => { + expect(screen.getByLabelText('Info Helper testing')).toBeInTheDocument(); + }); + }); }); diff --git a/src/lib/components/iconhelper/IconHelper.tsx b/src/lib/components/iconhelper/IconHelper.tsx index 8ec998bf35..3d54e4139a 100644 --- a/src/lib/components/iconhelper/IconHelper.tsx +++ b/src/lib/components/iconhelper/IconHelper.tsx @@ -6,18 +6,20 @@ type IconHelpProps = { tooltipMessage: ReactNode; placement?: Position; overlayStyle?: CSSProperties; + title?: string; }; export const IconHelp = ({ tooltipMessage, overlayStyle, placement = 'right', + title, }: IconHelpProps) => ( - + );