Skip to content

Commit 278f1f6

Browse files
author
Joachim Seminck
committed
Add a test when using conditional with a single line JSX: that should still be valid.
1 parent b75c01c commit 278f1f6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ const ARROW_NO_PAREN = `
134134
</div>;
135135
`;
136136

137+
const CONDITIONAL_SINGLE_LINE = `
138+
<div>
139+
{unreadMessages.length > 0 && <div>Hello World</div>}
140+
</div>
141+
`;
142+
137143
const CONDITIONAL_PAREN = `
138144
<div>
139145
{unreadMessages.length > 0 &&
@@ -212,6 +218,9 @@ ruleTester.run('jsx-wrap-multilines', rule, {
212218
}, {
213219
code: CONDITIONAL_PAREN,
214220
options: [{conditional: true}]
221+
}, {
222+
code: CONDITIONAL_SINGLE_LINE,
223+
options: [{conditional: true}]
215224
}, {
216225
code: CONDITIONAL_NO_PAREN
217226
}

0 commit comments

Comments
 (0)