Skip to content

Commit 2d2cf65

Browse files
authored
Merge pull request #1318 from DianaSuvorova/issue1309
[Tests] `no-unused-prop-types`: add test case Fixes #1309.
2 parents 6d0a8c2 + bb972f3 commit 2d2cf65

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/lib/rules/no-unused-prop-types.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,28 @@ ruleTester.run('no-unused-prop-types', rule, {
18911891
' children: React.PropTypes.node,',
18921892
'};'
18931893
].join('\n')
1894+
}, {
1895+
// issue 1309
1896+
code: [
1897+
'const Thing = (props) => (',
1898+
' <div>',
1899+
' {(() => {',
1900+
' if(props.enabled){',
1901+
' return (',
1902+
' <span>Enabled!</span>',
1903+
' )',
1904+
' }',
1905+
' return (',
1906+
' <span>Disabled..</span>',
1907+
' )',
1908+
' })()}',
1909+
' </div>',
1910+
');',
1911+
1912+
'Thing.propTypes = {',
1913+
' enabled: React.PropTypes.bool',
1914+
'};'
1915+
].join('\n')
18941916
}
18951917
],
18961918

0 commit comments

Comments
 (0)