Skip to content

Commit

Permalink
Merge pull request #1318 from DianaSuvorova/issue1309
Browse files Browse the repository at this point in the history
[Tests] `no-unused-prop-types`: add test case

Fixes #1309.
  • Loading branch information
ljharb authored Jul 23, 2017
2 parents 6d0a8c2 + bb972f3 commit 2d2cf65
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/lib/rules/no-unused-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,28 @@ ruleTester.run('no-unused-prop-types', rule, {
' children: React.PropTypes.node,',
'};'
].join('\n')
}, {
// issue 1309
code: [
'const Thing = (props) => (',
' <div>',
' {(() => {',
' if(props.enabled){',
' return (',
' <span>Enabled!</span>',
' )',
' }',
' return (',
' <span>Disabled..</span>',
' )',
' })()}',
' </div>',
');',

'Thing.propTypes = {',
' enabled: React.PropTypes.bool',
'};'
].join('\n')
}
],

Expand Down

0 comments on commit 2d2cf65

Please sign in to comment.