Skip to content

Commit 99d1de8

Browse files
committed
more tests
1 parent 6bf1509 commit 99d1de8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@ ruleTester.run('forbid-dom-props', rule, {
112112
},
113113
],
114114
},
115+
{
116+
code: `
117+
const First = (props) => (
118+
<html.span name="foo" />
119+
);
120+
const Second = (props) => (
121+
<h.span name="foo" />
122+
);
123+
`,
124+
options: [{ forbid: ['id'] }],
125+
},
115126
]),
116127

117128
invalid: parsers.all([
@@ -329,6 +340,9 @@ ruleTester.run('forbid-dom-props', rule, {
329340
const First = (props) => (
330341
<html.div id="foo" />
331342
);
343+
const Second = (props) => (
344+
<h.div id="foo" />
345+
);
332346
`,
333347
options: [{ forbid: ['id'] }],
334348
errors: [
@@ -339,6 +353,13 @@ ruleTester.run('forbid-dom-props', rule, {
339353
column: 16,
340354
type: 'JSXAttribute',
341355
},
356+
{
357+
messageId: 'propIsForbidden',
358+
data: { prop: 'id' },
359+
line: 6,
360+
column: 16,
361+
type: 'JSXAttribute',
362+
},
342363
],
343364
},
344365
]),

0 commit comments

Comments
 (0)