Skip to content

Commit 25deff6

Browse files
aickinsophiebits
authored andcommitted
Add more SSR unit tests for elements and children. (#9221)
* Adding more SSR unit tests for elements and children. * Some of my SSR tests were testing for react-text and react-empty elements that no longer exist in Fiber. Fixed the tests so that they expect correct markup in Fiber. * Tweaked some test names after @gaearon review comment #9221 (comment) . Also realized that one of the tests was essentially a direct copy of another, so deleted it. * Responding to code review #9221 (review) . Thanks @spicyj!
1 parent 0a41890 commit 25deff6

4 files changed

Lines changed: 778 additions & 0 deletions

File tree

scripts/fiber/tests-failing.txt

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,62 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js
4646
* renders unknown attributes for custom elements with client render on top of good server markup
4747
* renders unknown attributes for custom elements using is with client render on top of good server markup
4848
* renders no HTML events with client render on top of good server markup
49+
* renders a div with text with client render on top of good server markup
50+
* renders a div with text with flanking whitespace with client render on top of good server markup
51+
* renders a div with an empty text child with client render on top of good server markup
52+
* renders a div with multiple empty text children with server string render
53+
* renders a div with multiple empty text children with client render on top of good server markup
54+
* renders a div with multiple whitespace children with server string render
55+
* renders a div with multiple whitespace children with client render on top of good server markup
56+
* renders a div with text sibling to a node with server string render
57+
* renders a div with text sibling to a node with client render on top of good server markup
58+
* renders a non-standard element with text with client render on top of good server markup
59+
* renders a custom element with text with client render on top of good server markup
60+
* renders a leading blank child with a text sibling with server string render
61+
* renders a leading blank child with a text sibling with client render on top of good server markup
62+
* renders a trailing blank child with a text sibling with server string render
63+
* renders a trailing blank child with a text sibling with client render on top of good server markup
64+
* renders an element with two text children with server string render
65+
* renders an element with two text children with client render on top of good server markup
66+
* renders a number as single child with client render on top of good server markup
67+
* renders zero as single child with client render on top of good server markup
68+
* renders an element with number and text children with server string render
69+
* renders an element with number and text children with client render on top of good server markup
70+
* renders null single child as blank with client render on top of good server markup
71+
* renders false single child as blank with client render on top of good server markup
72+
* renders undefined single child as blank with client render on top of good server markup
73+
* renders a null component children as empty with server string render
74+
* renders a null component children as empty with client render on top of good server markup
75+
* renders null children as blank with server string render
76+
* renders null children as blank with client render on top of good server markup
77+
* renders false children as blank with server string render
78+
* renders false children as blank with client render on top of good server markup
79+
* renders null and false children together as blank with server string render
80+
* renders null and false children together as blank with client render on top of good server markup
81+
* renders only null and false children as blank with client render on top of good server markup
82+
* renders an svg element with client render on top of good server markup
83+
* renders svg element with an xlink with client render on top of good server markup
84+
* renders a math element with client render on top of good server markup
85+
* renders an img with client render on top of good server markup
86+
* renders a button with client render on top of good server markup
87+
* renders a div with dangerouslySetInnerHTML with client render on top of good server markup
88+
* renders a newline-eating tag with content not starting with \n with client render on top of good server markup
89+
* renders a newline-eating tag with content starting with \n with client render on top of good server markup
90+
* renders a normal tag with content starting with \n with client render on top of good server markup
91+
* renders stateless components with client render on top of good server markup
92+
* renders ES6 class components with client render on top of good server markup
93+
* renders factory components with client render on top of good server markup
94+
* renders single child hierarchies of components with client render on top of good server markup
95+
* renders multi-child hierarchies of components with client render on top of good server markup
96+
* renders a div with a child with client render on top of good server markup
97+
* renders a div with multiple children with client render on top of good server markup
98+
* renders a div with multiple children separated by whitespace with server string render
99+
* renders a div with multiple children separated by whitespace with client render on top of good server markup
100+
* renders a div with a single child surrounded by whitespace with server string render
101+
* renders a div with a single child surrounded by whitespace with client render on top of good server markup
102+
* renders >,<, and & as single child with client render on top of good server markup
103+
* renders >,<, and & as multiple children with server string render
104+
* renders >,<, and & as multiple children with client render on top of good server markup
49105

50106
src/renderers/dom/shared/__tests__/ReactDOMTextComponent-test.js
51107
* can reconcile text merged by Node.normalize() alongside other elements

scripts/fiber/tests-passing-except-dev.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,54 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js
4747
* renders unknown attributes for custom elements with client render on top of bad server markup
4848
* renders unknown attributes for custom elements using is with client render on top of bad server markup
4949
* renders no HTML events with client render on top of bad server markup
50+
* renders a div with text with client render on top of bad server markup
51+
* renders a div with text with flanking whitespace with client render on top of bad server markup
52+
* renders a div with an empty text child with client render on top of bad server markup
53+
* renders a div with multiple empty text children with client render on top of bad server markup
54+
* renders a div with multiple whitespace children with client render on top of bad server markup
55+
* renders a div with text sibling to a node with client render on top of bad server markup
56+
* renders a non-standard element with text with client render on top of bad server markup
57+
* renders a custom element with text with client render on top of bad server markup
58+
* renders a leading blank child with a text sibling with client render on top of bad server markup
59+
* renders a trailing blank child with a text sibling with client render on top of bad server markup
60+
* renders an element with two text children with client render on top of bad server markup
61+
* renders a number as single child with client render on top of bad server markup
62+
* renders zero as single child with client render on top of bad server markup
63+
* renders an element with number and text children with client render on top of bad server markup
64+
* renders null single child as blank with client render on top of bad server markup
65+
* renders false single child as blank with client render on top of bad server markup
66+
* renders undefined single child as blank with client render on top of bad server markup
67+
* renders a null component children as empty with client render on top of bad server markup
68+
* renders null children as blank with client render on top of bad server markup
69+
* renders false children as blank with client render on top of bad server markup
70+
* renders null and false children together as blank with client render on top of bad server markup
71+
* renders only null and false children as blank with client render on top of bad server markup
72+
* renders an svg element with client render on top of bad server markup
73+
* renders svg element with an xlink with client render on top of bad server markup
74+
* renders a math element with client render on top of bad server markup
75+
* renders an img with client render on top of bad server markup
76+
* renders a button with client render on top of bad server markup
77+
* renders a div with dangerouslySetInnerHTML with client render on top of bad server markup
78+
* renders a newline-eating tag with content not starting with \n with client render on top of bad server markup
79+
* renders a newline-eating tag with content starting with \n with client render on top of bad server markup
80+
* renders a normal tag with content starting with \n with client render on top of bad server markup
81+
* renders stateless components with client render on top of bad server markup
82+
* renders ES6 class components with client render on top of bad server markup
83+
* renders factory components with client render on top of bad server markup
84+
* renders single child hierarchies of components with client render on top of bad server markup
85+
* renders multi-child hierarchies of components with client render on top of bad server markup
86+
* renders a div with a child with client render on top of bad server markup
87+
* renders a div with multiple children with client render on top of bad server markup
88+
* renders a div with multiple children separated by whitespace with client render on top of bad server markup
89+
* renders a div with a single child surrounded by whitespace with client render on top of bad server markup
90+
* renders >,<, and & as single child with client render on top of bad server markup
91+
* renders >,<, and & as multiple children with client render on top of bad server markup
92+
* throws when rendering a string component with clean client render
93+
* throws when rendering a string component with client render on top of bad server markup
94+
* throws when rendering an undefined component with clean client render
95+
* throws when rendering an undefined component with client render on top of bad server markup
96+
* throws when rendering a number component with clean client render
97+
* throws when rendering a number component with client render on top of bad server markup
5098

5199
src/renderers/dom/shared/__tests__/ReactMount-test.js
52100
* should warn if mounting into dirty rendered markup

scripts/fiber/tests-passing.txt

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,94 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js
10661066
* renders unknown attributes for custom elements using is with clean client render
10671067
* renders no HTML events with server string render
10681068
* renders no HTML events with clean client render
1069+
* renders a div with text with server string render
1070+
* renders a div with text with clean client render
1071+
* renders a div with text with flanking whitespace with server string render
1072+
* renders a div with text with flanking whitespace with clean client render
1073+
* renders a div with an empty text child with server string render
1074+
* renders a div with an empty text child with clean client render
1075+
* renders a div with multiple empty text children with clean client render
1076+
* renders a div with multiple whitespace children with clean client render
1077+
* renders a div with text sibling to a node with clean client render
1078+
* renders a non-standard element with text with server string render
1079+
* renders a non-standard element with text with clean client render
1080+
* renders a custom element with text with server string render
1081+
* renders a custom element with text with clean client render
1082+
* renders a leading blank child with a text sibling with clean client render
1083+
* renders a trailing blank child with a text sibling with clean client render
1084+
* renders an element with two text children with clean client render
1085+
* renders a number as single child with server string render
1086+
* renders a number as single child with clean client render
1087+
* renders zero as single child with server string render
1088+
* renders zero as single child with clean client render
1089+
* renders an element with number and text children with clean client render
1090+
* renders null single child as blank with server string render
1091+
* renders null single child as blank with clean client render
1092+
* renders false single child as blank with server string render
1093+
* renders false single child as blank with clean client render
1094+
* renders undefined single child as blank with server string render
1095+
* renders undefined single child as blank with clean client render
1096+
* renders a null component children as empty with clean client render
1097+
* renders null children as blank with clean client render
1098+
* renders false children as blank with clean client render
1099+
* renders null and false children together as blank with clean client render
1100+
* renders only null and false children as blank with server string render
1101+
* renders only null and false children as blank with clean client render
1102+
* renders an svg element with server string render
1103+
* renders an svg element with clean client render
1104+
* renders svg element with an xlink with server string render
1105+
* renders svg element with an xlink with clean client render
1106+
* renders a math element with server string render
1107+
* renders a math element with clean client render
1108+
* renders an img with server string render
1109+
* renders an img with clean client render
1110+
* renders a button with server string render
1111+
* renders a button with clean client render
1112+
* renders a div with dangerouslySetInnerHTML with server string render
1113+
* renders a div with dangerouslySetInnerHTML with clean client render
1114+
* renders a newline-eating tag with content not starting with \n with server string render
1115+
* renders a newline-eating tag with content not starting with \n with clean client render
1116+
* renders a newline-eating tag with content starting with \n with server string render
1117+
* renders a newline-eating tag with content starting with \n with clean client render
1118+
* renders a normal tag with content starting with \n with server string render
1119+
* renders a normal tag with content starting with \n with clean client render
1120+
* renders stateless components with server string render
1121+
* renders stateless components with clean client render
1122+
* renders ES6 class components with server string render
1123+
* renders ES6 class components with clean client render
1124+
* renders factory components with server string render
1125+
* renders factory components with clean client render
1126+
* renders single child hierarchies of components with server string render
1127+
* renders single child hierarchies of components with clean client render
1128+
* renders multi-child hierarchies of components with server string render
1129+
* renders multi-child hierarchies of components with clean client render
1130+
* renders a div with a child with server string render
1131+
* renders a div with a child with clean client render
1132+
* renders a div with multiple children with server string render
1133+
* renders a div with multiple children with clean client render
1134+
* renders a div with multiple children separated by whitespace with clean client render
1135+
* renders a div with a single child surrounded by whitespace with clean client render
1136+
* renders >,<, and & as single child with server string render
1137+
* renders >,<, and & as single child with clean client render
1138+
* renders >,<, and & as multiple children with clean client render
1139+
* throws when rendering a string component with server string render
1140+
* throws when rendering an undefined component with server string render
1141+
* throws when rendering a number component with server string render
1142+
* throws when rendering null with server string render
1143+
* throws when rendering null with clean client render
1144+
* throws when rendering null with client render on top of bad server markup
1145+
* throws when rendering false with server string render
1146+
* throws when rendering false with clean client render
1147+
* throws when rendering false with client render on top of bad server markup
1148+
* throws when rendering undefined with server string render
1149+
* throws when rendering undefined with clean client render
1150+
* throws when rendering undefined with client render on top of bad server markup
1151+
* throws when rendering number with server string render
1152+
* throws when rendering number with clean client render
1153+
* throws when rendering number with client render on top of bad server markup
1154+
* throws when rendering string with server string render
1155+
* throws when rendering string with clean client render
1156+
* throws when rendering string with client render on top of bad server markup
10691157

10701158
src/renderers/dom/shared/__tests__/ReactDOMTextComponent-test.js
10711159
* updates a mounted text component in place

0 commit comments

Comments
 (0)