@@ -254,7 +254,7 @@ describe('Test plot api', function() {
254
254
} ) ;
255
255
} ) ;
256
256
257
- describe ( 'Plotly.restyle' , function ( ) {
257
+ describe ( 'Plotly.restyle subroutines switchboard ' , function ( ) {
258
258
beforeEach ( function ( ) {
259
259
spyOn ( PlotlyInternal , 'plot' ) ;
260
260
spyOn ( Plots , 'previousPromises' ) ;
@@ -330,6 +330,36 @@ describe('Test plot api', function() {
330
330
expect ( PlotlyInternal . plot ) . toHaveBeenCalled ( ) ;
331
331
} ) ;
332
332
333
+ it ( 'should do full replot when arrayOk base attributes are updated' , function ( ) {
334
+ var gd = {
335
+ data : [ { x : [ 1 , 2 , 3 ] , y : [ 1 , 2 , 3 ] } ] ,
336
+ layout : { }
337
+ } ;
338
+
339
+ mockDefaultsAndCalc ( gd ) ;
340
+ Plotly . restyle ( gd , 'hoverlabel.bgcolor' , [ [ 'red' , 'green' , 'blue' ] ] ) ;
341
+ expect ( gd . calcdata ) . toBeUndefined ( ) ;
342
+ expect ( PlotlyInternal . plot ) . toHaveBeenCalled ( ) ;
343
+
344
+ mockDefaultsAndCalc ( gd ) ;
345
+ PlotlyInternal . plot . calls . reset ( ) ;
346
+ Plotly . restyle ( gd , 'hoverlabel.bgcolor' , 'yellow' ) ;
347
+ expect ( gd . calcdata ) . toBeUndefined ( ) ;
348
+ expect ( PlotlyInternal . plot ) . toHaveBeenCalled ( ) ;
349
+
350
+ mockDefaultsAndCalc ( gd ) ;
351
+ PlotlyInternal . plot . calls . reset ( ) ;
352
+ Plotly . restyle ( gd , 'hoverlabel.bgcolor' , 'blue' ) ;
353
+ expect ( gd . calcdata ) . toBeDefined ( ) ;
354
+ expect ( PlotlyInternal . plot ) . not . toHaveBeenCalled ( ) ;
355
+
356
+ mockDefaultsAndCalc ( gd ) ;
357
+ PlotlyInternal . plot . calls . reset ( ) ;
358
+ Plotly . restyle ( gd , 'hoverlabel.bgcolor' , [ [ 'red' , 'blue' , 'green' ] ] ) ;
359
+ expect ( gd . calcdata ) . toBeUndefined ( ) ;
360
+ expect ( PlotlyInternal . plot ) . toHaveBeenCalled ( ) ;
361
+ } ) ;
362
+
333
363
it ( 'should do full replot when attribute container are updated' , function ( ) {
334
364
var gd = {
335
365
data : [ { x : [ 1 , 2 , 3 ] , y : [ 1 , 2 , 3 ] } ] ,
0 commit comments