diff --git a/spec/pivotal-ui-react/copy-to-clipboard/copy-to-clipboard_spec.js b/spec/pivotal-ui-react/copy-to-clipboard/copy-to-clipboard_spec.js index 4f449e421..f9410893c 100644 --- a/spec/pivotal-ui-react/copy-to-clipboard/copy-to-clipboard_spec.js +++ b/spec/pivotal-ui-react/copy-to-clipboard/copy-to-clipboard_spec.js @@ -48,7 +48,7 @@ describe('CopyToClipboard', () => { tooltip: 'Copied in' }); - $('.copy-to-clipboard').simulate('click'); + $('.copy-to-clipboard .tooltip').simulate('click'); expect('.tooltip-container').toHaveClass('tooltip-container-visible'); expect('.tooltip-content').toHaveText('Copied in'); diff --git a/src/react/copy-to-clipboard/copy-to-clipboard.js b/src/react/copy-to-clipboard/copy-to-clipboard.js index ee83bede3..fec43cba9 100644 --- a/src/react/copy-to-clipboard/copy-to-clipboard.js +++ b/src/react/copy-to-clipboard/copy-to-clipboard.js @@ -28,7 +28,7 @@ export class CopyToClipboard extends React.PureComponent { }; render() { - const {children, className, text, onClick, getWindow, tooltip = "Copied", ...others} = this.props; + const {children, text, onClick, getWindow, tooltip = "Copied", ...others} = this.props; const obj = {props: this.props, text: null}; const anchorProps = mergeProps(others, { @@ -37,11 +37,13 @@ export class CopyToClipboard extends React.PureComponent { role: 'button' }); - return ( + return ( - obj.text = ref}>{text} - {children} + + obj.text = ref}>{text} + {children} + - ); + ); } } \ No newline at end of file