@@ -59,10 +59,11 @@ describe('web components', () => {
5959 it ( 'passes property changes to props' , ( ) => {
6060 const el = document . createElement ( 'x-clock' ) ;
6161
62+ root . appendChild ( el ) ;
63+
6264 el . time = '10:28:57 PM' ;
6365 assert . equal ( el . time , '10:28:57 PM' ) ;
6466
65- root . appendChild ( el ) ;
6667 assert . equal (
6768 root . innerHTML ,
6869 '<x-clock time="10:28:57 PM"><span>10:28:57 PM</span></x-clock>'
@@ -86,10 +87,11 @@ describe('web components', () => {
8687 it ( 'passes simple properties changes to props' , ( ) => {
8788 const el = document . createElement ( 'x-dummy-button' ) ;
8889
90+ root . appendChild ( el ) ;
91+
8992 el . text = 'foo' ;
9093 assert . equal ( el . text , 'foo' ) ;
9194
92- root . appendChild ( el ) ;
9395 assert . equal (
9496 root . innerHTML ,
9597 '<x-dummy-button text="foo"><button>foo</button></x-dummy-button>'
@@ -108,10 +110,12 @@ describe('web components', () => {
108110
109111 let clicks = 0 ;
110112 const onClick = ( ) => clicks ++ ;
113+
114+ root . appendChild ( el ) ;
115+
111116 el . onClick = onClick ;
112117 assert . equal ( el . onClick , onClick ) ;
113118
114- root . appendChild ( el ) ;
115119 assert . equal (
116120 root . innerHTML ,
117121 '<x-dummy-button><button>click</button></x-dummy-button>'
@@ -327,8 +331,7 @@ describe('web components', () => {
327331
328332 const child = document
329333 . querySelector ( 'x-adopted-style-sheets' )
330- . shadowRoot
331- . querySelector ( '.styled-child' ) ;
334+ . shadowRoot . querySelector ( '.styled-child' ) ;
332335
333336 const style = getComputedStyle ( child ) ;
334337 assert . equal ( style . color , 'rgb(255, 0, 0)' ) ;
0 commit comments