Skip to content

Commit

Permalink
Merge pull request #215 from gemini-testing/empty-date
Browse files Browse the repository at this point in the history
feat: should not show date if it is empty
  • Loading branch information
CatWithApple authored Mar 28, 2019
2 parents 680526b + c3da7a3 commit 8862a95
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 8862a95

Please sign in to comment.