Skip to content

Commit

Permalink
test: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jaesoekjjang committed Feb 1, 2024
1 parent 7c2fb74 commit 3dfaaeb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/lib/rules/checked-requires-onchange-or-readonly.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ ruleTester.run('checked-requires-onchange-or-readonly', rule, {
'<input type="checkbox" checked onChange={noop} />',
'<input type="checkbox" checked readOnly />',
'<input type="checkbox" defaultChecked />',
'<span/>',
"React.createElement('input')",
"React.createElement('input', { checked: true, onChange: noop })",
"React.createElement('input', { checked: false, onChange: noop })",
"React.createElement('input', { checked: true, readOnly: true })",
"React.createElement('input', { checked: true, onChange: noop, readOnly: true })",
"React.createElement('span')",
{
code: '<input type="checkbox" checked />',
options: [{ ignoreMissingProperties: false }],
Expand All @@ -42,6 +41,9 @@ ruleTester.run('checked-requires-onchange-or-readonly', rule, {
code: '<input type="checkbox" onChange={noop} checked defaultChecked />',
options: [{ ignoreExclusiveCheckedAttribute: false }],
},
'<span/>',
"React.createElement('span')",
'(()=>{})()',
]),
invalid: parsers.all([
{
Expand Down

0 comments on commit 3dfaaeb

Please sign in to comment.