@@ -282,29 +282,36 @@ describe('Test plot api', function() {
282
282
expect ( gd . _fullData [ 0 ] . marker . color ) . toBe ( colorDflt [ 0 ] ) ;
283
283
expect ( gd . _fullData [ 1 ] . marker . color ) . toBe ( colorDflt [ 1 ] ) ;
284
284
} ) ;
285
+ } ) ;
285
286
286
- it ( 'should redo auto z/contour when editing z array' , function ( ) {
287
- var gd = {
288
- data : [ { type : 'contour' , z : [ [ 1 , 2 ] , [ 3 , 4 ] ] } ]
289
- } ;
287
+ describe ( 'Plotly.restyle unmocked' , function ( ) {
288
+ var gd ;
290
289
291
- mockDefaultsAndCalc ( gd ) ;
290
+ beforeEach ( function ( ) {
291
+ gd = createGraphDiv ( ) ;
292
+ } ) ;
292
293
293
- expect ( gd . data [ 0 ] . zauto ) . toBe ( true ) ;
294
- expect ( gd . data [ 0 ] . zmin ) . toBe ( 1 ) ;
295
- expect ( gd . data [ 0 ] . zmax ) . toBe ( 4 ) ;
294
+ afterEach ( function ( ) {
295
+ destroyGraphDiv ( ) ;
296
+ } ) ;
296
297
297
- expect ( gd . data [ 0 ] . autocontour ) . toBe ( true ) ;
298
- expect ( gd . data [ 0 ] . contours ) . toEqual ( { start : 0.5 , end : 3.5 , size : 0.5 } ) ;
298
+ it ( 'should redo auto z/contour when editing z array' , function ( ) {
299
+ Plotly . plot ( gd , [ { type : 'contour' , z : [ [ 1 , 2 ] , [ 3 , 4 ] ] } ] ) . then ( function ( ) {
300
+ expect ( gd . data [ 0 ] . zauto ) . toBe ( true , gd . data [ 0 ] ) ;
301
+ expect ( gd . data [ 0 ] . zmin ) . toBe ( 1 ) ;
302
+ expect ( gd . data [ 0 ] . zmax ) . toBe ( 4 ) ;
299
303
300
- Plotly . restyle ( gd , { 'z[0][0]' : 10 } ) ;
304
+ expect ( gd . data [ 0 ] . autocontour ) . toBe ( true ) ;
305
+ expect ( gd . data [ 0 ] . contours ) . toEqual ( { start : 1.5 , end : 3.5 , size : 0.5 } ) ;
301
306
302
- expect ( gd . data [ 0 ] . zmin ) . toBe ( 2 ) ;
303
- expect ( gd . data [ 0 ] . zmax ) . toBe ( 10 ) ;
307
+ return Plotly . restyle ( gd , { 'z[0][0]' : 10 } ) ;
308
+ } ) . then ( function ( ) {
309
+ expect ( gd . data [ 0 ] . zmin ) . toBe ( 2 ) ;
310
+ expect ( gd . data [ 0 ] . zmax ) . toBe ( 10 ) ;
304
311
305
- expect ( gd . data [ 0 ] . contours ) . toEqual ( { start : 3 , end : 9 , size : 1 } ) ;
312
+ expect ( gd . data [ 0 ] . contours ) . toEqual ( { start : 3 , end : 9 , size : 1 } ) ;
313
+ } ) ;
306
314
} ) ;
307
-
308
315
} ) ;
309
316
310
317
describe ( 'Plotly.deleteTraces' , function ( ) {
0 commit comments