@@ -578,9 +578,12 @@ suite('Component', function () {
578578
579579 suite ( 'third-party components' , function ( ) {
580580 var el ;
581- setup ( function ( ) {
581+ setup ( function ( done ) {
582582 el = entityFactory ( ) ;
583583 delete components . clone ;
584+ el . addEventListener ( 'loaded' , ( ) => {
585+ done ( ) ;
586+ } ) ;
584587 } ) ;
585588
586589 test ( 'can be registered' , function ( ) {
@@ -589,17 +592,13 @@ suite('Component', function () {
589592 assert . ok ( 'clone' in components ) ;
590593 } ) ;
591594
592- test ( 'can change behavior of entity' , function ( done ) {
595+ test ( 'can change behavior of entity' , function ( ) {
593596 registerComponent ( 'clone' , CloneComponent ) ;
594-
595- el . addEventListener ( 'loaded' , function ( ) {
596- assert . notOk ( 'clone' in el . components ) ;
597- assert . notOk ( el . object3D . children . length ) ;
598- el . setAttribute ( 'clone' , '' ) ;
599- assert . ok ( 'clone' in el . components ) ;
600- assert . equal ( el . object3D . children [ 0 ] . uuid , 'Bubble Fett' ) ;
601- done ( ) ;
602- } ) ;
597+ assert . notOk ( 'clone' in el . components ) ;
598+ assert . notOk ( el . object3D . children . length ) ;
599+ el . setAttribute ( 'clone' , '' ) ;
600+ assert . ok ( 'clone' in el . components ) ;
601+ assert . equal ( el . object3D . children [ 0 ] . uuid , 'Bubble Fett' ) ;
603602 } ) ;
604603
605604 test ( 'cannot be registered if it uses the character __ in the name' , function ( ) {
0 commit comments