diff options
author | 2021-09-25 00:34:30 -0700 | |
---|---|---|
committer | 2021-09-25 00:34:30 -0700 | |
commit | a5d3ce4e96475f9de6bf4a51bb6864bf5da0074b (patch) | |
tree | 3f6f9bf5dafde5d1c541b897959efe91efa454f9 /integration | |
parent | 66b29654c09f42807faeef859d4cea1f29520013 (diff) | |
download | bun-a5d3ce4e96475f9de6bf4a51bb6864bf5da0074b.tar.gz bun-a5d3ce4e96475f9de6bf4a51bb6864bf5da0074b.tar.zst bun-a5d3ce4e96475f9de6bf4a51bb6864bf5da0074b.zip |
Add integration test for <JSX key="foo" {...spread} onClick={() => {}} />
Diffstat (limited to 'integration')
-rw-r--r-- | integration/scripts/browser.js | 1 | ||||
-rw-r--r-- | integration/snippets/spread_with_key.tsx | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/integration/scripts/browser.js b/integration/scripts/browser.js index 4b7a2ef4a..9cd23e4ee 100644 --- a/integration/scripts/browser.js +++ b/integration/scripts/browser.js @@ -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(); diff --git a/integration/snippets/spread_with_key.tsx b/integration/snippets/spread_with_key.tsx new file mode 100644 index 000000000..9c26ea5ba --- /dev/null +++ b/integration/snippets/spread_with_key.tsx @@ -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); +} |