| 1 | /** @flow */ |
| 2 | |
| 3 | // This test harness mounts each test app as a separate root to test multi-root applications. |
| 4 | |
| 5 | import * as React from 'react'; |
| 6 | import * as ReactDOMClient from 'react-dom/client'; |
| 7 | |
| 8 | const container = document.createElement('div'); |
| 9 | |
| 10 | (document.body as any as HTMLBodyElement).appendChild(container); |
| 11 | |
| 12 | // TODO We may want to parameterize this app |
| 13 | // so that it can load things other than just ToDoList. |
| 14 | const App = require('../e2e-apps/ListApp').default; |
| 15 | |
| 16 | const root = ReactDOMClient.createRoot(container); |
| 17 | root.render(<App />); |
| 18 | |
| 19 | // ReactDOM Test Selector APIs used by Playwright e2e tests |
| 20 | window.parent.REACT_DOM_APP = ReactDOMClient; |