Skip to content

Commit 0ce122b

Browse files
author
Joachim Seminck
committed
Add another valid test case when the parenthesis are not on the same line as the opening/closing JSX elements
1 parent 64868fc commit 0ce122b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/lib/rules/jsx-wrap-multilines.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@ const CONDITIONAL_PAREN = `
150150
</div>
151151
`;
152152

153+
const CONDITIONAL_PAREN_DIFFERENT_LINE = `
154+
<div>
155+
{unreadMessages.length > 0 && (
156+
<h2>
157+
You have {unreadMessages.length} unread messages.
158+
</h2>
159+
)}
160+
</div>
161+
`;
162+
153163
const CONDITIONAL_NO_PAREN = `
154164
<div>
155165
{unreadMessages.length > 0 &&
@@ -218,6 +228,9 @@ ruleTester.run('jsx-wrap-multilines', rule, {
218228
}, {
219229
code: CONDITIONAL_PAREN,
220230
options: [{conditional: true}]
231+
}, {
232+
code: CONDITIONAL_PAREN_DIFFERENT_LINE,
233+
options: [{conditional: true}]
221234
}, {
222235
code: CONDITIONAL_SINGLE_LINE,
223236
options: [{conditional: true}]

0 commit comments

Comments
 (0)