Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove default title for icon #806

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/components/icon/Icon.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ function NonWrappedIcon({
color={color}
size={size}
ariaLabel={ariaLabel}
title={title || name}
title={title}
{...rest}
/>
)}
Expand Down
10 changes: 5 additions & 5 deletions src/lib/components/iconhelper/IconHelper.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { getWrapper } from '../../testUtils';
import userEvent from '@testing-library/user-event';
import { IconHelp } from './IconHelper';

describe('Icon', () => {
describe('IconHelper', () => {
const selectors = {
icon: () => screen.getByRole('img', { name: /Info/i }),
icon: () => screen.getByRole('img'),
};
const renderIcon = (tooltipMessage: React.ReactNode) => {
const { Wrapper } = getWrapper();
render(
<Wrapper>
<IconHelp tooltipMessage={tooltipMessage} />
<IconHelp tooltipMessage={tooltipMessage} title="Info" />
</Wrapper>,
);
};
Expand Down Expand Up @@ -41,12 +41,12 @@ describe('Icon', () => {
<Wrapper>
<IconHelp
tooltipMessage={'This is a tooltip'}
title="Info Helper testing"
title="Info Helper Testing"
/>
</Wrapper>,
);
await waitFor(() => {
expect(screen.getByLabelText('Info Helper testing')).toBeInTheDocument();
expect(screen.getByLabelText('Info Helper Testing')).toBeInTheDocument();
});
});
});
Loading