Skip to content

Commit

Permalink
fix(CopyButton): remove extraneous title attribute (#12394)
Browse files Browse the repository at this point in the history
* fix(CopyButton): remove extraneous title attribute

* test(CodeSNippet): update CodeSnippet tests to not use title attribute

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
tw15egan and kodiakhq[bot] committed Nov 14, 2022
1 parent a95ebe2 commit 3f54ea9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('CodeSnippet', () => {
</CodeSnippet>
);

expect(screen.getByTitle('Copy to clipboard')).toHaveAttribute('disabled');
expect(document.querySelector('button')).toHaveAttribute('disabled');
});
});

Expand All @@ -149,7 +149,7 @@ describe('CodeSnippet events', () => {
</CodeSnippet>
);

const button = screen.getByTitle('Copy to clipboard');
const button = document.querySelector('button');
userEvent.click(button);
expect(onClick).toHaveBeenCalled();
});
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/components/CopyButton/CopyButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default function CopyButton({ iconDescription, className, ...other }) {
<Copy
className={classnames(className, `${prefix}--copy-btn`)}
aria-label={iconDescription}
title={iconDescription}
{...other}>
<CopyIcon className={`${prefix}--snippet__icon`} />
</Copy>
Expand Down

0 comments on commit 3f54ea9

Please sign in to comment.