Skip to content

Commit

Permalink
fix: hide coverage stats if no coverage total
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed May 10, 2021
1 parent 09afcc2 commit d7d8426
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions ui/blocks/src/ComponentStats/ComponentStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,18 @@ export const ComponentStats: FC<{
color="status_failed"
/>
)}
<Shield
label="coverage"
title={`tests coverage by ${minCovField.field}`}
value={
coverage.total
? (100 * (coverage.covered / coverage.total)).toFixed(0)
: '0'
}
percent
/>
{coverage.total && (
<Shield
label="coverage"
title={`tests coverage by ${minCovField.field}`}
value={
coverage.total
? (100 * (coverage.covered / coverage.total)).toFixed(0)
: '0'
}
percent
/>
)}
</Fragment>
);
}
Expand Down

0 comments on commit d7d8426

Please sign in to comment.