@@ -131,7 +131,7 @@ function runTests(transitionDuration) {
131131 function getPath ( ) {
132132 return gd . _fullLayout . _shapeUpperLayer . select ( 'path' ) . node ( ) ;
133133 }
134- var p1 , p2 , d1 , d2 ;
134+ var p1 , p2 , p3 , d1 , d2 , d3 , s1 , s2 , s3 ;
135135
136136 Plotly . relayout ( gd , {
137137 shapes : [ {
@@ -149,6 +149,7 @@ function runTests(transitionDuration) {
149149 } ) . then ( function ( ) {
150150 p1 = getPath ( ) ;
151151 d1 = p1 . getAttribute ( 'd' ) ;
152+ s1 = p1 . getAttribute ( 'style' ) ;
152153
153154 return Plots . transition ( gd , null , {
154155 'shapes[0].x0' : 1 ,
@@ -160,11 +161,26 @@ function runTests(transitionDuration) {
160161 } ) . then ( function ( ) {
161162 p2 = getPath ( ) ;
162163 d2 = p2 . getAttribute ( 'd' ) ;
164+ s2 = p2 . getAttribute ( 'style' ) ;
163165
164166 // If object constancy is implemented, this will then be *equal*:
165167 expect ( p1 ) . not . toBe ( p2 ) ;
166-
167168 expect ( d1 ) . not . toEqual ( d2 ) ;
169+ expect ( s1 ) . toEqual ( s2 ) ;
170+
171+ return Plots . transition ( gd , null , {
172+ 'shapes[0].color' : 'red'
173+ } , [ ] ,
174+ { redraw : true , duration : transitionDuration } ,
175+ { duration : transitionDuration , easing : 'cubic-in-out' }
176+ ) ;
177+ } ) . then ( function ( ) {
178+ p3 = getPath ( ) ;
179+ d3 = p3 . getAttribute ( 'd' ) ;
180+ s3 = p3 . getAttribute ( 'd' ) ;
181+
182+ expect ( d3 ) . toEqual ( d2 ) ;
183+ expect ( s3 ) . not . toEqual ( s2 ) ;
168184 } ) . catch ( fail ) . then ( done ) ;
169185 } ) ;
170186
0 commit comments