.\n' +
+ ' in li (at **)\n' +
+ ' in div (at **)\n' +
+ ' in li (at **)\n' +
+ ' in ul (at **)',
+ ],
+ );
+ expectWarnings(
+ ['div', 'html'],
+ [
+ 'validateDOMNesting(...): cannot appear as a child of .\n' +
+ ' in html (at **)',
+ ],
+ );
+ expectWarnings(
+ ['body', 'body'],
+ [
+ 'render(): Rendering components directly into document.body is discouraged',
+ 'validateDOMNesting(...): cannot appear as a child of .\n' +
+ ' in body (at **)',
+ ],
+ );
+ expectWarnings(
+ ['svg', 'foreignObject', 'body', 'p'],
+ [
+ 'validateDOMNesting(...): cannot appear as a child of .\n' +
+ ' in body (at **)\n' +
+ ' in foreignObject (at **)',
+ ' is using uppercase HTML',
+ ],
+ );
+ });
+});
diff --git a/packages/react-dom/src/client/validateDOMNesting.js b/packages/react-dom/src/client/validateDOMNesting.js
index 8e6165d5e9912..9341bd1e3f591 100644
--- a/packages/react-dom/src/client/validateDOMNesting.js
+++ b/packages/react-dom/src/client/validateDOMNesting.js
@@ -482,17 +482,6 @@ if (__DEV__) {
// TODO: turn this into a named export
validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
-
- // For testing
- validateDOMNesting.isTagValidInContext = function(tag, ancestorInfo) {
- ancestorInfo = ancestorInfo || emptyAncestorInfo;
- const parentInfo = ancestorInfo.current;
- const parentTag = parentInfo && parentInfo.tag;
- return (
- isTagValidWithParent(tag, parentTag) &&
- !findInvalidAncestorForTag(tag, ancestorInfo)
- );
- };
}
export default validateDOMNesting;