@@ -285,7 +285,6 @@ describe('reactElementToJSXString(ReactElement)', () => {
285
285
286
286
it ( 'reactElementToJSXString(<div z="3" a="1" b="2"/>, {sortProps: false})' , ( ) => {
287
287
/* eslint react/jsx-sort-props: 0 */
288
-
289
288
expect (
290
289
reactElementToJSXString ( < div z = "3" a = "1" b = "2" /> , {
291
290
sortProps : false ,
@@ -923,20 +922,20 @@ describe('reactElementToJSXString(ReactElement)', () => {
923
922
'<This should take precedence />'
924
923
) ;
925
924
} ) ;
925
+
926
926
// maxInlineAttributesLineLength tests
927
927
// Validate two props will stay inline if their length is less than the option
928
-
929
928
it ( 'reactElementToJSXString(<div aprop="1" bprop="2" />, { maxInlineAttributesLineLength: 100 }))' , ( ) => {
930
929
expect (
931
930
reactElementToJSXString ( < div aprop = "1" bprop = "2" /> , {
932
931
maxInlineAttributesLineLength : 100 ,
933
932
} )
934
933
) . toEqual ( '<div aprop="1" bprop="2" />' ) ;
935
934
} ) ;
935
+
936
936
// Validate one prop will go to new line if length is greater than option. One prop is a special case since
937
937
// the old logic operated on whether or not two or more attributes were present. Making sure this overrides
938
938
// that older logic
939
-
940
939
it ( 'reactElementToJSXString(<div aprop="1"/>, { maxInlineAttributesLineLength: 5 }))' , ( ) => {
941
940
expect (
942
941
reactElementToJSXString ( < div aprop = "1" /> , {
@@ -946,8 +945,8 @@ describe('reactElementToJSXString(ReactElement)', () => {
946
945
aprop="1"
947
946
/>` ) ;
948
947
} ) ;
949
- // Validate two props will go be multiline if their length is greater than the given option
950
948
949
+ // Validate two props will go be multiline if their length is greater than the given option
951
950
it ( 'reactElementToJSXString(<div aprop="1" bprop="2" />, { maxInlineAttributesLineLength: 10 }))' , ( ) => {
952
951
expect (
953
952
reactElementToJSXString ( < div aprop = "1" bprop = "2" /> , {
@@ -958,9 +957,9 @@ describe('reactElementToJSXString(ReactElement)', () => {
958
957
bprop="2"
959
958
/>` ) ;
960
959
} ) ;
960
+
961
961
// Same tests as above but with elements that have children. The closing braces for elements with children and without children
962
962
// run through different code paths so we have both sets of test to specify the behavior of both when this option is present
963
-
964
963
it ( 'reactElementToJSXString(<div aprop="1" bprop="2">content</div>, { maxInlineAttributesLineLength: 100 }))' , ( ) => {
965
964
expect (
966
965
reactElementToJSXString (
@@ -1005,8 +1004,8 @@ describe('reactElementToJSXString(ReactElement)', () => {
1005
1004
content
1006
1005
</div>` ) ;
1007
1006
} ) ;
1008
- // Multi-level inline attribute test
1009
1007
1008
+ // Multi-level inline attribute test
1010
1009
it ( 'reactElementToJSXString(<div><div>content</div></div>, { maxInlineAttributesLineLength: 24 }))' , ( ) => {
1011
1010
expect (
1012
1011
reactElementToJSXString (
@@ -1040,9 +1039,7 @@ describe('reactElementToJSXString(ReactElement)', () => {
1040
1039
1041
1040
it ( 'sends the original fn to functionValue' , ( ) => {
1042
1041
const fn = ( ) => { } ;
1043
-
1044
1042
const functionValue = ( receivedFn ) => expect ( receivedFn ) . toBe ( fn ) ;
1045
-
1046
1043
reactElementToJSXString ( < div fn = { fn } /> , {
1047
1044
functionValue,
1048
1045
} ) ;
@@ -1119,7 +1116,9 @@ describe('reactElementToJSXString(ReactElement)', () => {
1119
1116
} }
1120
1117
/>
1121
1118
) ;
1119
+
1122
1120
const insideString = reactElementToJSXString ( inside ) ;
1121
+
1123
1122
return (
1124
1123
< div >
1125
1124
{ insideString }
@@ -1254,7 +1253,6 @@ describe('reactElementToJSXString(ReactElement)', () => {
1254
1253
1255
1254
it ( 'should stringify `Suspense` correctly' , ( ) => {
1256
1255
const Spinner = ( ) => null ;
1257
-
1258
1256
const ProfilePage = ( ) => null ;
1259
1257
1260
1258
expect (
@@ -1287,7 +1285,6 @@ describe('reactElementToJSXString(ReactElement)', () => {
1287
1285
1288
1286
it ( 'should stringify `Contex.Provider` correctly' , ( ) => {
1289
1287
const Ctx = React . createContext ( ) ;
1290
-
1291
1288
const App = ( ) => { } ;
1292
1289
1293
1290
expect (
@@ -1335,7 +1332,6 @@ describe('reactElementToJSXString(ReactElement)', () => {
1335
1332
1336
1333
it ( 'should stringify `Contex.Consumer` correctly' , ( ) => {
1337
1334
const Ctx = React . createContext ( ) ;
1338
-
1339
1335
const Button = ( ) => null ;
1340
1336
1341
1337
expect (
0 commit comments