Skip to content

Commit

Permalink
Add more invalid tests cases for forbid-dom-props
Browse files Browse the repository at this point in the history
  • Loading branch information
davazp committed Nov 22, 2017
1 parent 2c2d831 commit 28654e2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/lib/rules/forbid-dom-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,33 @@ ruleTester.run('forbid-element-props', rule, {
column: 17,
type: 'JSXAttribute'
}]
}, {
code: [
'class First extends createReactClass {',
' render() {',
' return <div id="bar" />;',
' }',
'}'
].join('\n'),
options: [{forbid: ['id']}],
errors: [{
message: ID_ERROR_MESSAGE,
line: 3,
column: 17,
type: 'JSXAttribute'
}]
}, {
code: [
'const First = (props) => (',
' <div id="foo" />',
');'
].join('\n'),
options: [{forbid: ['id']}],
errors: [{
message: ID_ERROR_MESSAGE,
line: 2,
column: 8,
type: 'JSXAttribute'
}]
}]
});

0 comments on commit 28654e2

Please sign in to comment.