@@ -12,17 +12,14 @@ var mouseEvent = require('../assets/mouse_event');
1212var failTest = require ( '../assets/fail_test' ) ;
1313var selectButton = require ( '../assets/modebar_button' ) ;
1414var drag = require ( '../assets/drag' ) ;
15- var click = require ( '../assets/click' ) ;
1615var doubleClick = require ( '../assets/double_click' ) ;
1716var getNodeCoords = require ( '../assets/get_node_coords' ) ;
1817var delay = require ( '../assets/delay' ) ;
1918
2019var customAssertions = require ( '../assets/custom_assertions' ) ;
2120var assertNodeDisplay = customAssertions . assertNodeDisplay ;
22- var assertHoverLabelContent = customAssertions . assertHoverLabelContent ;
2321
2422var MODEBAR_DELAY = 500 ;
25- var HOVERMINTIME = require ( '@src/components/fx' ) . constants . HOVERMINTIME ;
2623
2724describe ( 'zoom box element' , function ( ) {
2825 var mock = require ( '@mocks/14.json' ) ;
@@ -2292,7 +2289,7 @@ describe('Cartesian plots with css transforms', function() {
22922289 function _dragRelease ( start , end ) {
22932290 var localEnd = _getLocalPos ( gd , end ) ;
22942291 _drag ( start , end ) ;
2295- mouseEvent ( 'mouseup' , localEnd [ 0 ] , localEnd [ 1 ] ) ;
2292+ mouseEvent ( 'mouseup' , localEnd [ 0 ] , localEnd [ 1 ] ) ;
22962293 }
22972294
22982295 function _hover ( pos ) {
@@ -2333,9 +2330,7 @@ describe('Cartesian plots with css transforms', function() {
23332330 var transforms = [ 'scale(0.5)' ] ;
23342331
23352332 transforms . forEach ( function ( transform ) {
2336-
2337- it ( `hover behaves correctly after css transform: ${ transform } ` , function ( done ) {
2338-
2333+ it ( 'hover behaves correctly after css transform: ' + transform , function ( done ) {
23392334 function _hoverAndAssertEventOccurred ( point , label ) {
23402335 return _hover ( point )
23412336 . then ( function ( ) {
@@ -2345,7 +2340,7 @@ describe('Cartesian plots with css transforms', function() {
23452340 _unhover ( point ) ;
23462341 } ) ;
23472342 }
2348-
2343+
23492344 Plotly . plot ( gd , Lib . extendDeep ( { } , mock ) )
23502345 . then ( function ( ) {
23512346 gd . on ( 'plotly_hover' , function ( d ) {
@@ -2362,9 +2357,8 @@ describe('Cartesian plots with css transforms', function() {
23622357 . catch ( failTest )
23632358 . then ( done ) ;
23642359 } ) ;
2365-
2366- it ( `drag-zoom behaves correctly after css transform: ${ transform } ` , function ( done ) {
2367-
2360+
2361+ it ( 'drag-zoom behaves correctly after css transform: ' + transform , function ( done ) {
23682362 // return a rect of form {left, top, width, height} from the zoomlayer
23692363 // svg path.
23702364 function _getZoomlayerPathRect ( pathStr ) {
@@ -2376,7 +2370,7 @@ describe('Cartesian plots with css transforms', function() {
23762370 rect . top = Number ( startCoordsString . split ( ',' ) [ 1 ] ) ;
23772371 return rect ;
23782372 }
2379-
2373+
23802374 // asserts that the zoombox path must go from the start to end positions,
23812375 // in css-transformed coordinates.
23822376 function _assertTransformedZoombox ( startPos , endPos ) {
@@ -2390,41 +2384,41 @@ describe('Cartesian plots with css transforms', function() {
23902384 expect ( zoomboxRect . width ) . toBeCloseTo ( size [ 0 ] ) ;
23912385 expect ( zoomboxRect . height ) . toBeCloseTo ( size [ 1 ] ) ;
23922386 }
2393-
2387+
23942388 var start = [ 50 , 50 ] ;
2395- var end = [ 150 , 150 ]
2396-
2389+ var end = [ 150 , 150 ] ;
2390+
23972391 Plotly . plot ( gd , Lib . extendDeep ( { } , mock ) )
23982392 . then ( function ( ) {
23992393 transformPlot ( gd , transform ) ;
24002394 recalculateInverse ( gd ) ;
24012395 } )
2402- . then ( function ( ) { _drag ( start , end ) ; } )
2403- . then ( function ( ) {
2404- _assertTransformedZoombox ( start , end ) ;
2396+ . then ( function ( ) { _drag ( start , end ) ; } )
2397+ . then ( function ( ) {
2398+ _assertTransformedZoombox ( start , end ) ;
24052399 } )
24062400 . then ( function ( ) { mouseEvent ( 'mouseup' , 0 , 0 ) ; } )
24072401 . catch ( failTest )
24082402 . then ( done ) ;
24092403 } ) ;
2410-
2411- it ( `select behaves correctly after css transform: ${ transform } ` , function ( done ) {
2412-
2404+
2405+ it ( 'select behaves correctly after css transform: ' + transform , function ( done ) {
24132406 function _assertSelected ( expectation ) {
24142407 var data = gd . _fullData [ 0 ] ;
24152408 var points = data . selectedpoints ;
24162409 expect ( typeof ( points ) !== 'undefined' ) . toBeTrue ( ) ;
2417- if ( expectation . numPoints )
2410+ if ( expectation . numPoints ) {
24182411 expect ( points . length ) . toBe ( expectation . numPoints ) ;
2419- if ( expectation . selectedLabels ) {
2420- var selectedLabels = points . map ( function ( i ) { return data . x [ i ] ; } )
2412+ }
2413+ if ( expectation . selectedLabels ) {
2414+ var selectedLabels = points . map ( function ( i ) { return data . x [ i ] ; } ) ;
24212415 expect ( selectedLabels ) . toEqual ( expectation . selectedLabels ) ;
24222416 }
24232417 }
2424-
2418+
24252419 var start = [ 10 , 10 ] ;
24262420 var end = [ 200 , 200 ] ;
2427-
2421+
24282422 Plotly . plot ( gd , Lib . extendDeep ( { } , mock ) )
24292423 . then ( function ( ) {
24302424 transformPlot ( gd , transform ) ;
@@ -2437,11 +2431,10 @@ describe('Cartesian plots with css transforms', function() {
24372431 _dragRelease ( start , end ) ;
24382432 } )
24392433 . then ( function ( ) {
2440- _assertSelected ( { numPoints : 2 , selectedLabels : [ " one" , " two" ] } ) ;
2434+ _assertSelected ( { numPoints : 2 , selectedLabels : [ ' one' , ' two' ] } ) ;
24412435 } )
24422436 . catch ( failTest )
24432437 . then ( done ) ;
24442438 } ) ;
24452439 } ) ;
2446-
2447- } ) ;
2440+ } ) ;
0 commit comments