Skip to content

Commit 28654e2

Browse files
committed
Add more invalid tests cases for forbid-dom-props
1 parent 2c2d831 commit 28654e2

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/lib/rules/forbid-dom-props.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,33 @@ ruleTester.run('forbid-element-props', rule, {
100100
column: 17,
101101
type: 'JSXAttribute'
102102
}]
103+
}, {
104+
code: [
105+
'class First extends createReactClass {',
106+
' render() {',
107+
' return <div id="bar" />;',
108+
' }',
109+
'}'
110+
].join('\n'),
111+
options: [{forbid: ['id']}],
112+
errors: [{
113+
message: ID_ERROR_MESSAGE,
114+
line: 3,
115+
column: 17,
116+
type: 'JSXAttribute'
117+
}]
118+
}, {
119+
code: [
120+
'const First = (props) => (',
121+
' <div id="foo" />',
122+
');'
123+
].join('\n'),
124+
options: [{forbid: ['id']}],
125+
errors: [{
126+
message: ID_ERROR_MESSAGE,
127+
line: 2,
128+
column: 8,
129+
type: 'JSXAttribute'
130+
}]
103131
}]
104132
});

0 commit comments

Comments
 (0)