Files
react/packages/react-devtools-shell/src/e2e/app.js
T
Luna Ruan 3133dfa6ee DevTools] e2e Regression Testing App (#24619)
This PR adds an e2e regression app to the react-devtools-shell package. This app:

* Has an app.js and an appLegacy.js entrypoint because apps prior to React 18 need to use ReactDOM.render. These files will create and render multiple test apps (though they currently only render the List)
* Moved the ListApp out of the e2e folder and into an e2e-apps folder so that both e2e and e2e-regression can use the same test apps
* Creates a ListAppLegacy app because prior to React 16.8 hooks didn't exist.
* Added a devtools file for the e2e-regression
* Modifies the webpack config so that the e2e-regression React app can use different a different React version than DevTools
2022-05-26 11:36:00 -04:00

22 lines
654 B
JavaScript

/** @flow */
// This test harness mounts each test app as a separate root to test multi-root applications.
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import {createRoot} from 'react-dom/client';
const container = document.createElement('div');
((document.body: any): HTMLBodyElement).appendChild(container);
// TODO We may want to parameterize this app
// so that it can load things other than just ToDoList.
const App = require('../e2e-apps/ListApp').default;
const root = createRoot(container);
root.render(<App />);
// ReactDOM Test Selector APIs used by Playwright e2e tests
window.parent.REACT_DOM_APP = ReactDOM;