File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,19 @@ append that div to the `document.body` and this is where your react component
192192will be rendered . If you provide your own HTMLElement ` container ` via this
193193option , it will not be appended to the ` document.body ` automatically .
194194
195+ For Example :
196+ If you are unit testing a ` tablebody ` element , it cannot be a child of a ` div ` .
197+ In this case , you can specify a ` table ` as the render ` container ` .
198+
199+ ` ` ` javascript
200+ const table = document.createElement('table');
201+
202+ const { container } = render(
203+ <TableBody {...props} />,
204+ { container: document.body.appendChild(table) }
205+ );
206+ ` ` `
207+
195208** baseElement ** : If the ` container ` is specified , then this defaults to that ,
196209otherwise this defaults to ` document.documentElement ` . This is used as the base
197210element for the queries as well as what is printed when you use ` debug() ` .
You can’t perform that action at this time.
0 commit comments