Skip to content

Commit

Permalink
feat: should not show date if it is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
CatWithApple committed Mar 28, 2019
1 parent 680526b commit c3da7a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/static/components/summary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,25 @@ class Summary extends Component {
skipped: PropTypes.number.isRequired,
retries: PropTypes.number.isRequired
}),
date: PropTypes.string.isRequired
date: PropTypes.string
}

render() {
const {date} = this.props;
const {total, passed, failed, skipped, retries} = this.props.stats;

const dateBlock = date
? <div className='summary__date'>created at {date}</div>
: null;

return (
<dl className="summary">
<SummaryKey label="Total Tests" value={total}/>
<SummaryKey label="Passed" value={passed}/>
<SummaryKey label="Failed" value={failed} isFailed={true}/>
<SummaryKey label="Skipped" value={skipped}/>
<SummaryKey label="Retries" value={retries}/>
<div className='summary__date'>created at {date}</div>
{dateBlock}
</dl>
);
}
Expand Down

0 comments on commit c3da7a3

Please sign in to comment.