Skip to content

Commit b2e45f0

Browse files
committed
test(jsx-no-leaked-render): add more tests for nested logical expressions
1 parent cead83e commit b2e45f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/lib/rules/jsx-no-leaked-render.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ ruleTester.run('jsx-no-leaked-render', rule, {
133133
`,
134134
},
135135

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

0 commit comments

Comments
 (0)