(
component,
size = { width: 100, height: 100 }
)
| 29 | * @return {HTMLElement} |
| 30 | */ |
| 31 | export const renderTestComponent = ( |
| 32 | component, |
| 33 | size = { width: 100, height: 100 } |
| 34 | ) => { |
| 35 | root = document.createElement("div"); |
| 36 | root.style.position = "relative"; |
| 37 | changeRootSize(size); |
| 38 | document.body.appendChild(root); |
| 39 | |
| 40 | ReactDOM.render(component, root); |
| 41 | |
| 42 | componentElement = root.children[0]; |
| 43 | |
| 44 | return componentElement; |
| 45 | }; |
| 46 | |
| 47 | export const clearDOM = () => (document.body.innerHTML = ""); |
| 48 |
no test coverage detected