(props, children, test = noop)
| 237 | * |
| 238 | */ |
| 239 | export const withModal = function(props, children, test = noop) { |
| 240 | return withElementCollector(() => { |
| 241 | const node = createHTMLElement(); |
| 242 | const modalProps = { ariaHideApp: false, ...props }; |
| 243 | let modal; |
| 244 | try { |
| 245 | ReactDOM.render( |
| 246 | <Modal ref={m => (modal = m)} {...modalProps}> |
| 247 | {children} |
| 248 | </Modal>, |
| 249 | node |
| 250 | ); |
| 251 | test(modal); |
| 252 | } finally { |
| 253 | ReactDOM.unmountComponentAtNode(node); |
| 254 | } |
| 255 | }); |
| 256 | }; |
no test coverage detected
searching dependent graphs…