Add integration test for <JSX key="foo" {...spread} onClick={() => {}} />

This commit is contained in:
Jarred Sumner
2021-09-25 00:34:30 -07:00
parent 66b29654c0
commit a5d3ce4e96
2 changed files with 21 additions and 0 deletions

View File

@@ -117,6 +117,7 @@ async function main() {
"/array-args-with-default-values.js",
"/forbid-in-is-correct.js",
"/code-simplification-neql-define.js",
"/spread_with_key.tsx",
];
tests.reverse();

View File

@@ -0,0 +1,20 @@
import React from "react";
export function SpreadWithTheKey({ className }: Props) {
const rest = {};
return (
<div
className={className}
key="spread-with-the-key"
{...rest}
onClick={() => console.log("click")}
>
Rendered component containing warning
</div>
);
}
export function test() {
console.assert(React.isValidElement(<SpreadWithTheKey className="foo" />));
return testDone(import.meta.url);
}