Skip to content

Commit 652749d

Browse files
committed
[Tests] no-unknown-property: add passing tests for allowTransparency
1 parent a2ec87d commit 652749d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/lib/rules/no-unknown-property.js

+20
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ ruleTester.run('no-unknown-property', rule, {
5757
{ code: '<meta property="og:type" content="website" />' },
5858
{ code: '<input type="checkbox" checked={checked} disabled={disabled} id={id} onChange={onChange} />' },
5959
{ code: '<video playsInline />' },
60+
{
61+
code: '<div allowTransparency="true" />',
62+
settings: {
63+
react: { version: '16.0.99' },
64+
},
65+
},
6066
// React related attributes
6167
{ code: '<div onPointerDown={this.onDown} onPointerUp={this.onUp} />' },
6268
{ code: '<input type="checkbox" defaultChecked={this.state.checkbox} />' },
@@ -96,6 +102,20 @@ ruleTester.run('no-unknown-property', rule, {
96102
{ code: '<audio onAbort={this.abort} onDurationChange={this.durationChange} onEmptied={this.emptied} onEnded={this.end} onError={this.error}></audio>' },
97103
]),
98104
invalid: parsers.all([
105+
{
106+
code: '<div allowTransparency="true" />',
107+
settings: {
108+
react: { version: '16.1.0' },
109+
},
110+
errors: [
111+
{
112+
messageId: 'unknownProp',
113+
data: {
114+
name: 'allowTransparency',
115+
},
116+
},
117+
],
118+
},
99119
{
100120
code: '<div hasOwnProperty="should not be allowed property"></div>;',
101121
errors: [

0 commit comments

Comments
 (0)