@@ -16,14 +16,14 @@ describe('controller', () => {
1616 class ControllerRegisterElement extends HTMLElement { }
1717 controller ( ControllerRegisterElement )
1818 const instance = document . createElement ( 'controller-register' )
19- document . body . appendChild ( instance )
19+ root . appendChild ( instance )
2020 expect ( instance ) . to . be . instanceof ( ControllerRegisterElement )
2121 } )
2222
2323 it ( 'adds data-catalyst to elements' , async ( ) => {
2424 controller ( class ControllerDataAttrElement extends HTMLElement { } )
2525 const instance = document . createElement ( 'controller-data-attr' )
26- document . body . appendChild ( instance )
26+ root . appendChild ( instance )
2727 expect ( instance . hasAttribute ( 'data-catalyst' ) ) . to . equal ( true )
2828 expect ( instance . getAttribute ( 'data-catalyst' ) ) . to . equal ( '' )
2929 } )
@@ -40,7 +40,7 @@ describe('controller', () => {
4040
4141 const instance = document . createElement ( 'controller-bind-order' )
4242 chai . spy . on ( instance , 'foo' )
43- document . body . appendChild ( instance )
43+ root . appendChild ( instance )
4444
4545 const sub = document . createElement ( 'controller-bind-order-sub' )
4646 sub . setAttribute ( 'data-action' , 'loaded:controller-bind-order#foo' )
@@ -62,7 +62,7 @@ describe('controller', () => {
6262 )
6363 const instance = document . createElement ( 'controller-bind-shadow' )
6464 chai . spy . on ( instance , 'foo' )
65- document . body . appendChild ( instance )
65+ root . appendChild ( instance )
6666
6767 instance . shadowRoot . querySelector ( 'button' ) . click ( )
6868
@@ -78,7 +78,7 @@ describe('controller', () => {
7878 template . innerHTML = '<button data-action="click:controller-bind-auto-shadow#foo"></button>'
7979 instance . appendChild ( template )
8080 chai . spy . on ( instance , 'foo' )
81- document . body . appendChild ( instance )
81+ root . appendChild ( instance )
8282
8383 expect ( instance . shadowRoot ) . to . exist
8484 expect ( instance ) . to . have . property ( 'shadowRoot' ) . not . equal ( null )
0 commit comments