Skip to content

Commit

Permalink
Test case that breaks the cleanup of empty classname
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-davis-sonarsource committed Dec 21, 2022
1 parent acb72a4 commit 31b98ef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/jest/test/__snapshots__/react-enzyme.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,14 @@ exports[`enzyme shallow with prop containing css element with other props 1`] =
</div>
`;

exports[`enzyme shallow with prop containing empty classname 1`] = `
<div>
<span>
Hi
</span>
</div>
`;

exports[`enzyme shallow with prop containing regular element 1`] = `
<button>
Foo
Expand Down
8 changes: 8 additions & 0 deletions packages/jest/test/react-enzyme.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ const cases = {
)
}
},
'with prop containing empty classname': {
render() {
const Thing = ({ renderProp }) => {
return <div>{renderProp}</div>
}
return <Thing renderProp={<span className="">Hi</span>} />
}
},
'with array of styles as css prop': {
render() {
const style1 = css`
Expand Down

0 comments on commit 31b98ef

Please sign in to comment.