Skip to content

Commit

Permalink
[Tests] button-has-type: add test case with spread
Browse files Browse the repository at this point in the history
  • Loading branch information
y-hsgw authored and ljharb committed Apr 9, 2024
1 parent 5b54adb commit 605b6af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
* [Tests] add @typescript-eslint/parser v7 and v8 ([#3629][] @hampustagerud)
* [Docs] [`no-danger`]: update broken link ([#3817][] @lucasrmendonca)
* [types] add jsdoc type annotations ([#3731][] @y-hsgw)
* [Tests] `button-has-type`: add test case with spread ([#3731][] @y-hsgw)

[#3632]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3632

Expand Down
6 changes: 6 additions & 0 deletions tests/lib/rules/button-has-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ ruleTester.run('button-has-type', rule, {
},
],
},
{
code: 'React.createElement("button", {...extraProps})',
errors: [
{ messageId: 'missingType' },
],
},
{
code: 'Foo.createElement("button")',
errors: [
Expand Down

0 comments on commit 605b6af

Please sign in to comment.