add unit test coverage for TowerLogo.jsx

This commit is contained in:
Jake McDermott
2019-01-07 07:30:58 -05:00
parent 4936238344
commit 8756da59fa
4 changed files with 21 additions and 31 deletions

View File

@@ -18,13 +18,11 @@ class TowerLogo extends Component {
}
onClick () {
const { history, onClick: handleClick } = this.props;
const { history, linkTo } = this.props;
if (!handleClick) return;
if (!linkTo) return;
history.push('/');
handleClick();
history.push(linkTo);
}
onHover () {
@@ -35,11 +33,10 @@ class TowerLogo extends Component {
render () {
const { hover } = this.state;
const { onClick: handleClick } = this.props;
let src = TowerLogoHeader;
if (hover && handleClick) {
if (hover) {
src = TowerLogoHeaderHover;
}