Skip to content

Commit

Permalink
[Tests] no-unknown-property: add passing tests for allowTransparency
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Sep 4, 2022
1 parent a2ec87d commit 652749d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ ruleTester.run('no-unknown-property', rule, {
{ code: '<meta property="og:type" content="website" />' },
{ code: '<input type="checkbox" checked={checked} disabled={disabled} id={id} onChange={onChange} />' },
{ code: '<video playsInline />' },
{
code: '<div allowTransparency="true" />',
settings: {
react: { version: '16.0.99' },
},
},
// React related attributes
{ code: '<div onPointerDown={this.onDown} onPointerUp={this.onUp} />' },
{ code: '<input type="checkbox" defaultChecked={this.state.checkbox} />' },
Expand Down Expand Up @@ -96,6 +102,20 @@ ruleTester.run('no-unknown-property', rule, {
{ code: '<audio onAbort={this.abort} onDurationChange={this.durationChange} onEmptied={this.emptied} onEnded={this.end} onError={this.error}></audio>' },
]),
invalid: parsers.all([
{
code: '<div allowTransparency="true" />',
settings: {
react: { version: '16.1.0' },
},
errors: [
{
messageId: 'unknownProp',
data: {
name: 'allowTransparency',
},
},
],
},
{
code: '<div hasOwnProperty="should not be allowed property"></div>;',
errors: [
Expand Down

0 comments on commit 652749d

Please sign in to comment.