Skip to content

Commit

Permalink
Code golf
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer committed Dec 14, 2023
1 parent ffe54d9 commit 796cccd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Tag/Tag.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('Tag', () => {
it('should render a button', () => {
const onClick = vi.fn();
render(<Tag onClick={onClick}>Button</Tag>);
const buttonEl = screen.getByRole('button', { name: 'Button' });
const buttonEl = screen.getByRole('button');
expect(buttonEl).toBeVisible();
expect(buttonEl).toHaveAttribute('type', 'button');
});
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Tag/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ export const Tag = forwardRef<HTMLDivElement & HTMLButtonElement, TagProps>(
'The `removeButtonLabel` prop is missing or invalid. Omit the `onRemove` prop if you intend to disable the tag removing functionality.',
);
}
let Element: AsPropType = 'div';

let Element: AsPropType = 'div';
if (props.href) {
Element = Link;
} else if (onClick) {
Expand Down

0 comments on commit 796cccd

Please sign in to comment.