@@ -648,6 +648,24 @@ describe('jsxLoader.js', function() {
648
648
expect ( js ) . to . equal ( '"use strict";\nReact.createElement(Test, {message: "test", value: 123}, "Hello")' ) ;
649
649
} ) ;
650
650
651
+ it ( 'should compile nested element with newline' , function ( ) {
652
+ resetIfUsingPreact ( ) ;
653
+ var jsx = '<Test message="test" value={123}><div\ntitle="test">Hello</div></Test>' ;
654
+ var js = jsxLoader . compiler . compile ( jsx ) ;
655
+ console . log ( js ) ;
656
+ console . log ( JSON . stringify ( js ) ) ;
657
+ expect ( js ) . to . equal ( '"use strict";\nReact.createElement(Test, {message: "test", value: 123}, \n React.createElement("div", {title: "test"}, "Hello"))' ) ;
658
+ } ) ;
659
+
660
+ it ( 'should compile nested element with tab' , function ( ) {
661
+ resetIfUsingPreact ( ) ;
662
+ var jsx = '<Test message="test" value={123}><div\ttitle="test">Hello</div></Test>' ;
663
+ var js = jsxLoader . compiler . compile ( jsx ) ;
664
+ console . log ( js ) ;
665
+ console . log ( JSON . stringify ( js ) ) ;
666
+ expect ( js ) . to . equal ( '"use strict";\nReact.createElement(Test, {message: "test", value: 123}, \n React.createElement("div", {title: "test"}, "Hello"))' ) ;
667
+ } ) ;
668
+
651
669
it ( 'should have correct child whitespace nodes' , function ( ) {
652
670
resetIfUsingPreact ( ) ;
653
671
var jsx = '<div><strong className={this.props.cssClass}>Test:</strong> {this.props.name} <section>Test [{this.props.name}] <span className="test">Test2</span></section></div>' ;
@@ -863,4 +881,4 @@ describe('<JsonData>', function() {
863
881
expect ( el . style . color ) . to . equal ( 'rgb(255, 255, 255)' ) ;
864
882
} ) ;
865
883
} ) ;
866
- } ) ;
884
+ } ) ;
0 commit comments