@@ -323,34 +323,29 @@ describe('The legend', function() {
323
323
scrollBarX = scrollBar . getAttribute ( 'x' ) ,
324
324
scrollBarY = scrollBar . getAttribute ( 'y' ) ;
325
325
326
- Plotly . relayout ( gd , 'showlegend' , false )
327
- . then ( function ( ) {
328
- Plotly . relayout ( gd , 'showlegend' , true ) ;
329
- } )
330
- . then ( function ( ) {
331
- legend = getLegend ( ) ;
332
- scrollBox = getScrollBox ( ) ;
333
- scrollBar = getScrollBar ( ) ;
334
- toggle = getToggle ( ) ;
335
-
336
- legend . dispatchEvent ( scrollTo ( wheelDeltaY ) ) ;
337
- expect ( scrollBar . getAttribute ( 'x' ) ) . toBe ( scrollBarX ) ;
338
- expect ( scrollBar . getAttribute ( 'y' ) ) . toBe ( scrollBarY ) ;
339
-
340
- var dataScroll = getScroll ( gd ) ;
341
- toggle . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
342
- toggle . dispatchEvent ( new MouseEvent ( 'mouseup' ) ) ;
343
- setTimeout ( function ( ) {
344
- expect ( + toggle . parentNode . style . opacity ) . toBeLessThan ( 1 ) ;
345
- expect ( getScroll ( gd ) ) . toBe ( dataScroll ) ;
346
- expect ( scrollBox . getAttribute ( 'transform' ) ) . toBe (
347
- 'translate(0,' + - dataScroll + ')' ) ;
348
- expect ( scrollBar . getAttribute ( 'width' ) ) . toBeGreaterThan ( 0 ) ;
349
- expect ( scrollBar . getAttribute ( 'height' ) ) . toBeGreaterThan ( 0 ) ;
350
- } , DBLCLICKDELAY * 2 ) ;
351
- } )
352
- . catch ( failTest )
353
- . then ( done ) ;
326
+ Plotly . relayout ( gd , 'showlegend' , false ) ;
327
+ Plotly . relayout ( gd , 'showlegend' , true ) ;
328
+ legend = getLegend ( ) ;
329
+ scrollBox = getScrollBox ( ) ;
330
+ scrollBar = getScrollBar ( ) ;
331
+ toggle = getToggle ( ) ;
332
+
333
+ legend . dispatchEvent ( scrollTo ( wheelDeltaY ) ) ;
334
+ expect ( scrollBar . getAttribute ( 'x' ) ) . toBe ( scrollBarX ) ;
335
+ expect ( scrollBar . getAttribute ( 'y' ) ) . toBe ( scrollBarY ) ;
336
+
337
+ var dataScroll = getScroll ( gd ) ;
338
+ toggle . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
339
+ toggle . dispatchEvent ( new MouseEvent ( 'mouseup' ) ) ;
340
+ setTimeout ( function ( ) {
341
+ expect ( + toggle . parentNode . style . opacity ) . toBeLessThan ( 1 ) ;
342
+ expect ( getScroll ( gd ) ) . toBe ( dataScroll ) ;
343
+ expect ( scrollBox . getAttribute ( 'transform' ) ) . toBe (
344
+ 'translate(0,' + - dataScroll + ')' ) ;
345
+ expect ( scrollBar . getAttribute ( 'width' ) ) . toBeGreaterThan ( 0 ) ;
346
+ expect ( scrollBar . getAttribute ( 'height' ) ) . toBeGreaterThan ( 0 ) ;
347
+ done ( ) ;
348
+ } , DBLCLICKDELAY * 2 ) ;
354
349
} ) ;
355
350
356
351
it ( 'should constrain scrolling to the contents' , function ( ) {
0 commit comments