Skip to content

Commit

Permalink
Test :Add a small test for ReactTestUtils to find rendered component …
Browse files Browse the repository at this point in the history
…with type in document (#24368)

I tried to write test for the ReactTestUtils to find rendered component
with type in document

Tests before this PR

![Windows PowerShell 4_13_2022 11_35_24
PM](https://user-images.githubusercontent.com/72331432/163243620-40eb753c-4136-4793-a628-efcf9e004562.png)

Tests after this PR

![Windows PowerShell 4_13_2022 11_35_30
PM](https://user-images.githubusercontent.com/72331432/163244704-cd17f0e3-7289-4794-895a-be03753e46de.png)

DiffTrain build for [4fcc918](4fcc918)
[View git log for this commit](https://github.com/facebook/react/commits/4fcc9184ac2662186cbf1470005bf2b7c67dd40b)
  • Loading branch information
eps1lon committed Feb 17, 2023
1 parent 53facba commit 4810084
Show file tree
Hide file tree
Showing 28 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
42106558ed31a186ea76ea548db3d7e1427c8043
4fcc9184ac2662186cbf1470005bf2b7c67dd40b
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
42106558ed31a186ea76ea548db3d7e1427c8043
4fcc9184ac2662186cbf1470005bf2b7c67dd40b
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-www-classic-42106558e-20230216";
var ReactVersion = "18.3.0-www-classic-4fcc9184a-20230217";

// ATTENTION
// When adding new symbols to this file,
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-www-modern-42106558e-20230216";
var ReactVersion = "18.3.0-www-modern-4fcc9184a-20230217";

// ATTENTION
// When adding new symbols to this file,
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,4 +646,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-classic-42106558e-20230216";
exports.version = "18.3.0-www-classic-4fcc9184a-20230217";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,4 +638,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-modern-42106558e-20230216";
exports.version = "18.3.0-www-modern-4fcc9184a-20230217";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-classic-42106558e-20230216";
exports.version = "18.3.0-www-classic-4fcc9184a-20230217";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-modern-42106558e-20230216";
exports.version = "18.3.0-www-modern-4fcc9184a-20230217";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = "18.3.0-www-classic-42106558e-20230216";
var ReactVersion = "18.3.0-www-classic-4fcc9184a-20230217";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = "18.3.0-www-modern-42106558e-20230216";
var ReactVersion = "18.3.0-www-modern-4fcc9184a-20230217";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -9844,7 +9844,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-classic-42106558e-20230216",
version: "18.3.0-www-classic-4fcc9184a-20230217",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1318 = {
Expand Down Expand Up @@ -9875,7 +9875,7 @@ var internals$jscomp$inline_1318 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-42106558e-20230216"
reconcilerVersion: "18.3.0-next-4fcc9184a-20230217"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1319 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -9509,7 +9509,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-modern-42106558e-20230216",
version: "18.3.0-www-modern-4fcc9184a-20230217",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1309 = {
Expand Down Expand Up @@ -9540,7 +9540,7 @@ var internals$jscomp$inline_1309 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-42106558e-20230216"
reconcilerVersion: "18.3.0-next-4fcc9184a-20230217"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1310 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -41946,7 +41946,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-classic-42106558e-20230216";
var ReactVersion = "18.3.0-www-classic-4fcc9184a-20230217";

function createPortal(
children,
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -41670,7 +41670,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-modern-42106558e-20230216";
var ReactVersion = "18.3.0-www-modern-4fcc9184a-20230217";

function createPortal(
children,
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -15436,7 +15436,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1743 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-42106558e-20230216",
version: "18.3.0-www-classic-4fcc9184a-20230217",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2106 = {
Expand Down Expand Up @@ -15466,7 +15466,7 @@ var internals$jscomp$inline_2106 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-42106558e-20230216"
reconcilerVersion: "18.3.0-next-4fcc9184a-20230217"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2107 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -15714,4 +15714,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-next-42106558e-20230216";
exports.version = "18.3.0-next-4fcc9184a-20230217";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -14996,7 +14996,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1711 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-42106558e-20230216",
version: "18.3.0-www-modern-4fcc9184a-20230217",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2081 = {
Expand Down Expand Up @@ -15027,7 +15027,7 @@ var internals$jscomp$inline_2081 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-42106558e-20230216"
reconcilerVersion: "18.3.0-next-4fcc9184a-20230217"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2082 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -15215,4 +15215,4 @@ exports.unstable_flushControlled = function (fn) {
}
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-next-42106558e-20230216";
exports.version = "18.3.0-next-4fcc9184a-20230217";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16206,7 +16206,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1817 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-42106558e-20230216",
version: "18.3.0-www-classic-4fcc9184a-20230217",
rendererPackageName: "react-dom"
};
(function (internals) {
Expand Down Expand Up @@ -16250,7 +16250,7 @@ var devToolsConfig$jscomp$inline_1817 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-42106558e-20230216"
reconcilerVersion: "18.3.0-next-4fcc9184a-20230217"
});
assign(Internals, {
ReactBrowserEventEmitter: {
Expand Down Expand Up @@ -16485,7 +16485,7 @@ exports.unstable_renderSubtreeIntoContainer = function (
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-next-42106558e-20230216";
exports.version = "18.3.0-next-4fcc9184a-20230217";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOM-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -15756,7 +15756,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1785 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-42106558e-20230216",
version: "18.3.0-www-modern-4fcc9184a-20230217",
rendererPackageName: "react-dom"
};
(function (internals) {
Expand Down Expand Up @@ -15801,7 +15801,7 @@ var devToolsConfig$jscomp$inline_1785 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-42106558e-20230216"
reconcilerVersion: "18.3.0-next-4fcc9184a-20230217"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = function (children, container) {
Expand Down Expand Up @@ -15976,7 +15976,7 @@ exports.unstable_flushControlled = function (fn) {
}
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-next-42106558e-20230216";
exports.version = "18.3.0-next-4fcc9184a-20230217";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");

var ReactVersion = "18.3.0-www-classic-42106558e-20230216";
var ReactVersion = "18.3.0-www-classic-4fcc9184a-20230217";

// This refers to a WWW module.
var warningWWW = require("warning");
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");

var ReactVersion = "18.3.0-www-modern-42106558e-20230216";
var ReactVersion = "18.3.0-www-modern-4fcc9184a-20230217";

// This refers to a WWW module.
var warningWWW = require("warning");
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -3654,4 +3654,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "18.3.0-www-classic-42106558e-20230216";
exports.version = "18.3.0-www-classic-4fcc9184a-20230217";
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -3562,4 +3562,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "18.3.0-www-modern-42106558e-20230216";
exports.version = "18.3.0-www-modern-4fcc9184a-20230217";
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMTesting-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -31318,7 +31318,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-classic-42106558e-20230216";
var ReactVersion = "18.3.0-www-classic-4fcc9184a-20230217";

function createPortal(
children,
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMTesting-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -37765,7 +37765,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-modern-42106558e-20230216";
var ReactVersion = "18.3.0-www-modern-4fcc9184a-20230217";

function createPortal(
children,
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOMTesting-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11556,7 +11556,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1538 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-42106558e-20230216",
version: "18.3.0-www-classic-4fcc9184a-20230217",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2057 = {
Expand Down Expand Up @@ -11586,7 +11586,7 @@ var internals$jscomp$inline_2057 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-42106558e-20230216"
reconcilerVersion: "18.3.0-next-4fcc9184a-20230217"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2058 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -14764,4 +14764,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-next-42106558e-20230216";
exports.version = "18.3.0-next-4fcc9184a-20230217";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOMTesting-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -13871,7 +13871,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1666 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-42106558e-20230216",
version: "18.3.0-www-modern-4fcc9184a-20230217",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2044 = {
Expand Down Expand Up @@ -13902,7 +13902,7 @@ var internals$jscomp$inline_2044 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-42106558e-20230216"
reconcilerVersion: "18.3.0-next-4fcc9184a-20230217"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2045 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -14233,4 +14233,4 @@ exports.unstable_flushControlled = function (fn) {
}
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-next-42106558e-20230216";
exports.version = "18.3.0-next-4fcc9184a-20230217";
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactTestRenderer-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -23913,7 +23913,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-classic-42106558e-20230216";
var ReactVersion = "18.3.0-www-classic-4fcc9184a-20230217";

// Might add PROFILE later.

Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactTestRenderer-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -23913,7 +23913,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-modern-42106558e-20230216";
var ReactVersion = "18.3.0-www-modern-4fcc9184a-20230217";

// Might add PROFILE later.

Expand Down

0 comments on commit 4810084

Please sign in to comment.