@@ -131,7 +131,7 @@ function runTests(transitionDuration) {
131
131
function getPath ( ) {
132
132
return gd . _fullLayout . _shapeUpperLayer . select ( 'path' ) . node ( ) ;
133
133
}
134
- var p1 , p2 , d1 , d2 ;
134
+ var p1 , p2 , p3 , d1 , d2 , d3 , s1 , s2 , s3 ;
135
135
136
136
Plotly . relayout ( gd , {
137
137
shapes : [ {
@@ -149,6 +149,7 @@ function runTests(transitionDuration) {
149
149
} ) . then ( function ( ) {
150
150
p1 = getPath ( ) ;
151
151
d1 = p1 . getAttribute ( 'd' ) ;
152
+ s1 = p1 . getAttribute ( 'style' ) ;
152
153
153
154
return Plots . transition ( gd , null , {
154
155
'shapes[0].x0' : 1 ,
@@ -160,11 +161,26 @@ function runTests(transitionDuration) {
160
161
} ) . then ( function ( ) {
161
162
p2 = getPath ( ) ;
162
163
d2 = p2 . getAttribute ( 'd' ) ;
164
+ s2 = p2 . getAttribute ( 'style' ) ;
163
165
164
166
// If object constancy is implemented, this will then be *equal*:
165
167
expect ( p1 ) . not . toBe ( p2 ) ;
166
-
167
168
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 ) ;
168
184
} ) . catch ( fail ) . then ( done ) ;
169
185
} ) ;
170
186
0 commit comments