@@ -198,6 +198,23 @@ ruleTester.run('jsx-indent', rule, {
198198 '</div>'
199199 ] . join ( '\n' ) ,
200200 parserOptions : parserOptions
201+ } , {
202+ code : [
203+ 'this.props.asd.length > 0 ?' ,
204+ ' <Button className="bacon-yay">{this.props.asd.length}</Button> :' ,
205+ ' <span className="bacon-no-trigger">0</span>'
206+ ] . join ( '\n' ) ,
207+ parserOptions : parserOptions
208+ } , {
209+ code : [
210+ '<div>' ,
211+ ' {this.props.asd.length > 0 ?' ,
212+ ' <Button className="bacon-yay">{this.props.asd.length}</Button> :' ,
213+ ' <span className="bacon-no-trigger">0</span>' ,
214+ ' }' ,
215+ '</div>'
216+ ] . join ( '\n' ) ,
217+ parserOptions : parserOptions
201218 } ] ,
202219
203220 invalid : [ {
@@ -447,5 +464,45 @@ ruleTester.run('jsx-indent', rule, {
447464 errors : [
448465 { message : 'Expected indentation of 2 space characters but found 0.' }
449466 ]
467+ } , {
468+ code : [
469+ 'this.props.asd.length > 0 ?' ,
470+ ' <Button className="bacon-yay">{this.props.asd.length}</Button> :' ,
471+ ' <span className="bacon-no-trigger">0</span>'
472+ ] . join ( '\n' ) ,
473+ output : [
474+ 'this.props.asd.length > 0 ?' ,
475+ ' <Button className="bacon-yay">{this.props.asd.length}</Button> :' ,
476+ ' <span className="bacon-no-trigger">0</span>'
477+ ] . join ( '\n' ) ,
478+ parserOptions : parserOptions ,
479+ errors : [ {
480+ message : 'Expected indentation of 4 space characters but found 8.' ,
481+ line : 3 ,
482+ column : 9
483+ } ]
484+ } , {
485+ code : [
486+ '<div>' ,
487+ ' {this.props.asd.length > 0 ?' ,
488+ ' <Button className="bacon-yay">{this.props.asd.length}</Button> :' ,
489+ ' <span className="bacon-no-trigger">0</span>' ,
490+ ' }' ,
491+ '</div>'
492+ ] . join ( '\n' ) ,
493+ output : [
494+ '<div>' ,
495+ ' {this.props.asd.length > 0 ?' ,
496+ ' <Button className="bacon-yay">{this.props.asd.length}</Button> :' ,
497+ ' <span className="bacon-no-trigger">0</span>' ,
498+ ' }' ,
499+ '</div>'
500+ ] . join ( '\n' ) ,
501+ parserOptions : parserOptions ,
502+ errors : [ {
503+ message : 'Expected indentation of 8 space characters but found 4.' ,
504+ line : 4 ,
505+ column : 5
506+ } ]
450507 } ]
451508} ) ;
0 commit comments