Skip to content

Commit

Permalink
fix: <Icon/> types still weren't correct
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Mar 13, 2024
1 parent bbe900f commit 3b3d91e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/Icon/Icon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,13 @@ describe('<Icon />', () => {

expect(iconSpan.classList.contains('pgn__icon__xs')).toEqual(true);
});

it('receives style or other arbitrary HTML properties correctly', () => {
const { container } = render(<Icon src={BlankSrc} style={{ color: 'red' }} size="xs" />);
const iconSpans = container.querySelectorAll('span');
const iconSpan = iconSpans[0];

expect(iconSpan.style.color).toEqual('red');
});
});
});
2 changes: 1 addition & 1 deletion src/Icon/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

export interface IconProps {
export interface IconProps extends React.ComponentPropsWithoutRef<'span'> {
src?: React.ReactElement | Function;
svgAttrs?: {
'aria-label'?: string;
Expand Down

0 comments on commit 3b3d91e

Please sign in to comment.