Skip to content
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
4 changes: 2 additions & 2 deletions packages/react-core/src/components/Alert/AlertActionLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { Button, ButtonVariant, ButtonProps } from '../Button';
*/

export interface AlertActionLinkProps extends ButtonProps {
/** Content rendered inside the alert action link. */
children?: string;
/** Content rendered inside the alert action link. Interactive content such as anchor elements should not be passed in. */
children?: React.ReactNode;
/** Additional classes added to the alert action link. */
className?: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ test('Renders children', () => {
expect(screen.getByRole('button')).toBeVisible();
});

test('Renders ReactNode as children', () => {
render(
<AlertActionLink>
<div>
<span>Learn More</span>
</div>
</AlertActionLink>
);

expect(screen.getByText('Learn More')).toBeVisible();
});

test('Renders with custom class names provided via prop', () => {
render(<AlertActionLink className="custom-class">Test</AlertActionLink>);

Expand Down