Skip to content

Commit

Permalink
fix(Progress): do not show progress without progress or label props
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezinwa Okpoechi committed Feb 20, 2017
1 parent 691f51e commit b248a18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/modules/Progress/Progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,9 @@ class Progress extends Component {
}

showProgress = () => {
const { label, precision, progress, total, value } = this.props
const { label, precision, progress } = this.props

if (label || progress || !_.isUndefined(precision)) return true
return !(_.every([total, value], _.isUndefined))
return label || progress || !_.isUndefined(precision)
}

render() {
Expand Down
2 changes: 1 addition & 1 deletion test/specs/modules/Progress/Progress-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ describe('Progress', () => {

describe('total/value', () => {
it('calculates the percent complete', () => {
shallow(<Progress value={1} total={2} />)
shallow(<Progress value={1} total={2} progress />)
.children()
.find('.progress')
.should.contain.text('50%')
Expand Down

0 comments on commit b248a18

Please sign in to comment.