@@ -127,6 +127,29 @@ suite('animation', function () {
127127 assert . equal ( el . object3D . position . z , 0 ) ;
128128 } ) ;
129129
130+ test ( 'can animate object3D.position directly with no from' , function ( ) {
131+ el . setAttribute ( 'position' , '3 3 3' ) ;
132+ el . setAttribute ( 'animation' , {
133+ property : 'object3D.position' ,
134+ dur : 1000 ,
135+ to : '5 5 5'
136+ } ) ;
137+ let setAttributeSpy = this . sinon . spy ( el , 'setAttribute' ) ;
138+ component . tick ( 0 , 1 ) ;
139+ // setAttribute not called to update the position. object3D updated directly.
140+ assert . notOk ( setAttributeSpy . called ) ;
141+ assert . equal ( el . object3D . position . x , 3 ) ;
142+ assert . equal ( el . object3D . position . y , 3 ) ;
143+ assert . equal ( el . object3D . position . z , 3 ) ;
144+ component . tick ( 0 , 500 ) ;
145+ assert . ok ( el . object3D . position . x > 3 ) ;
146+ assert . ok ( el . object3D . position . x < 5 ) ;
147+ component . tick ( 0 , 500 ) ;
148+ assert . equal ( el . object3D . position . x , 5 ) ;
149+ assert . equal ( el . object3D . position . y , 5 ) ;
150+ assert . equal ( el . object3D . position . z , 5 ) ;
151+ } ) ;
152+
130153 test ( 'can animate object3D value directly' , function ( ) {
131154 el . setAttribute ( 'animation' , {
132155 property : 'object3D.position.x' ,
0 commit comments