@@ -198,9 +198,8 @@ suite('Component', function () {
198198 el . setAttribute ( 'material' , 'color: red' ) ;
199199 el . addEventListener ( 'componentchanged' , function ( evt ) {
200200 if ( evt . detail . name !== 'material' ) { return ; }
201- assert . equal ( evt . detail . oldData . color , 'red' ) ;
202- assert . equal ( evt . detail . newData . color , 'blue' ) ;
203201 assert . equal ( evt . detail . name , 'material' ) ;
202+ assert . equal ( el . getAttribute ( 'material' ) . color , 'blue' ) ;
204203 assert . ok ( 'id' in evt . detail ) ;
205204 done ( ) ;
206205 } ) ;
@@ -213,8 +212,7 @@ suite('Component', function () {
213212 el . setAttribute ( 'position' , { x : 0 , y : 0 , z : 0 } ) ;
214213 el . addEventListener ( 'componentchanged' , function ( evt ) {
215214 if ( evt . detail . name !== 'position' ) { return ; }
216- assert . shallowDeepEqual ( evt . detail . oldData , { x : 0 , y : 0 , z : 0 } ) ;
217- assert . shallowDeepEqual ( evt . detail . newData , { x : 1 , y : 2 , z : 3 } ) ;
215+ assert . shallowDeepEqual ( el . getAttribute ( 'position' ) , { x : 1 , y : 2 , z : 3 } ) ;
218216 assert . equal ( evt . detail . name , 'position' ) ;
219217 assert . ok ( 'id' in evt . detail ) ;
220218 done ( ) ;
@@ -227,8 +225,7 @@ suite('Component', function () {
227225 test ( 'emits componentchanged for value' , function ( done ) {
228226 el . addEventListener ( 'componentchanged' , function ( evt ) {
229227 if ( evt . detail . name !== 'visible' ) { return ; }
230- assert . shallowDeepEqual ( evt . detail . oldData , true ) ;
231- assert . shallowDeepEqual ( evt . detail . newData , false ) ;
228+ assert . equal ( el . getAttribute ( 'visible' ) , false ) ;
232229 assert . equal ( evt . detail . name , 'visible' ) ;
233230 done ( ) ;
234231 } ) ;
@@ -353,7 +350,6 @@ suite('Component', function () {
353350 test ( 'emits componentinitialized' , function ( done ) {
354351 el . addEventListener ( 'componentinitialized' , function ( evt ) {
355352 if ( evt . detail . name !== 'material' ) { return ; }
356- assert . ok ( evt . detail . data ) ;
357353 assert . ok ( 'id' in evt . detail ) ;
358354 assert . equal ( evt . detail . name , 'material' ) ;
359355 done ( ) ;
@@ -652,8 +648,9 @@ suite('Component', function () {
652648 schema : { color : { default : 'red' } } ,
653649 update : function ( ) { this . el . setAttribute ( 'dummy' , 'color' , 'blue' ) ; }
654650 } ) ;
655- this . el . addEventListener ( 'componentchanged' , function ( evt ) {
656- assert . equal ( 'blue' , evt . detail . newData . color ) ;
651+ this . el . addEventListener ( 'componentchanged' , evt => {
652+ assert . equal ( evt . detail . name , 'dummy' ) ;
653+ assert . equal ( this . el . getAttribute ( 'dummy' ) . color , 'blue' ) ;
657654 done ( ) ;
658655 } ) ;
659656 var component = new TestComponent ( this . el ) ;
0 commit comments