Skip to content

Commit

Permalink
test(jsx-no-leaked-render): add more tests for nested logical express…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
Belco90 committed May 26, 2022
1 parent cead83e commit b2e45f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/lib/rules/jsx-no-leaked-render.js
Expand Up @@ -133,7 +133,9 @@ ruleTester.run('jsx-no-leaked-render', rule, {
`,
},

// Fixes for // https://github.com/jsx-eslint/eslint-plugin-react/issues/3297
// Fixes for:
// - https://github.com/jsx-eslint/eslint-plugin-react/issues/3292
// - https://github.com/jsx-eslint/eslint-plugin-react/issues/3297
{
// It shouldn't delete valid alternate from ternary expressions when "coerce" is the only valid strategy
options: [{ validStrategies: ['coerce'] }],
Expand Down Expand Up @@ -167,6 +169,7 @@ ruleTester.run('jsx-no-leaked-render', rule, {
<div>{!!direction && direction === "down" && "▼"}</div>
<div>{direction === "down" && !!direction && "▼"}</div>
<div>{direction === "down" || !!direction && "▼"}</div>
<div>{(!display || display === DISPLAY.WELCOME) && <span>foo</span>}</div>
</div>
)
}
Expand Down

0 comments on commit b2e45f0

Please sign in to comment.