@@ -2327,7 +2327,7 @@ describe('Test plot api', function() {
2327
2327
// legend and ticks get called initially, but then plot gets added during automargin
2328
2328
countCalls ( { doLegend : 1 , doTicksRelayout : 1 , plot : 1 } ) ;
2329
2329
2330
- data = [ { x : [ 0 , 1 ] , y : [ 0 , 1 ] , z : [ [ 1 , 2 ] , [ 3 , 4 ] ] , type : 'surface' } ] ;
2330
+ data = [ { z : [ [ 1 , 2 ] , [ 3 , 4 ] ] , type : 'surface' } ] ;
2331
2331
layout = { } ;
2332
2332
2333
2333
return Plotly . react ( gd , data , layout ) ;
@@ -2563,6 +2563,44 @@ describe('Test plot api', function() {
2563
2563
. catch ( fail )
2564
2564
. then ( done ) ;
2565
2565
} ) ;
2566
+
2567
+ var mockList = [
2568
+ [ '1' , require ( '@mocks/1.json' ) ] ,
2569
+ [ '4' , require ( '@mocks/4.json' ) ] ,
2570
+ [ '5' , require ( '@mocks/5.json' ) ] ,
2571
+ [ '10' , require ( '@mocks/10.json' ) ] ,
2572
+ [ '11' , require ( '@mocks/11.json' ) ] ,
2573
+ [ '17' , require ( '@mocks/17.json' ) ] ,
2574
+ [ '21' , require ( '@mocks/21.json' ) ] ,
2575
+ [ '22' , require ( '@mocks/22.json' ) ] ,
2576
+ // ['airfoil', require('@mocks/airfoil.json')],
2577
+ [ 'annotations-autorange' , require ( '@mocks/annotations-autorange.json' ) ] ,
2578
+ [ 'axes_enumerated_ticks' , require ( '@mocks/axes_enumerated_ticks.json' ) ] ,
2579
+ [ 'axes_visible-false' , require ( '@mocks/axes_visible-false.json' ) ] ,
2580
+ [ 'bar_and_histogram' , require ( '@mocks/bar_and_histogram.json' ) ] ,
2581
+ [ 'binding' , require ( '@mocks/binding.json' ) ] ,
2582
+ [ 'cheater_smooth' , require ( '@mocks/cheater_smooth.json' ) ] ,
2583
+ [ 'finance_style' , require ( '@mocks/finance_style.json' ) ] ,
2584
+ [ 'geo_first' , require ( '@mocks/geo_first.json' ) ] ,
2585
+ [ 'gl2d_line_dash' , require ( '@mocks/gl2d_line_dash.json' ) ] ,
2586
+ [ 'gl2d_parcoords_2' , require ( '@mocks/gl2d_parcoords_2.json' ) ] ,
2587
+ [ 'gl2d_pointcloud-basic' , require ( '@mocks/gl2d_pointcloud-basic.json' ) ] ,
2588
+ [ 'gl3d_world-cals' , require ( '@mocks/gl3d_world-cals.json' ) ] ,
2589
+ [ 'gl3d_set-ranges' , require ( '@mocks/gl3d_set-ranges.json' ) ]
2590
+ ] ;
2591
+
2592
+ mockList . forEach ( function ( mockSpec ) {
2593
+ it ( 'can redraw "' + mockSpec [ 0 ] + '" with no changes as a noop' , function ( done ) {
2594
+ var mock = mockSpec [ 1 ] ;
2595
+
2596
+ Plotly . newPlot ( gd , mock )
2597
+ . then ( countPlots )
2598
+ . then ( function ( ) { return Plotly . react ( gd , mock ) ; } )
2599
+ . then ( function ( ) { countCalls ( { } ) ; } )
2600
+ . catch ( fail )
2601
+ . then ( done ) ;
2602
+ } ) ;
2603
+ } ) ;
2566
2604
} ) ;
2567
2605
} ) ;
2568
2606
0 commit comments