@@ -12,17 +12,14 @@ var mouseEvent = require('../assets/mouse_event');
12
12
var failTest = require ( '../assets/fail_test' ) ;
13
13
var selectButton = require ( '../assets/modebar_button' ) ;
14
14
var drag = require ( '../assets/drag' ) ;
15
- var click = require ( '../assets/click' ) ;
16
15
var doubleClick = require ( '../assets/double_click' ) ;
17
16
var getNodeCoords = require ( '../assets/get_node_coords' ) ;
18
17
var delay = require ( '../assets/delay' ) ;
19
18
20
19
var customAssertions = require ( '../assets/custom_assertions' ) ;
21
20
var assertNodeDisplay = customAssertions . assertNodeDisplay ;
22
- var assertHoverLabelContent = customAssertions . assertHoverLabelContent ;
23
21
24
22
var MODEBAR_DELAY = 500 ;
25
- var HOVERMINTIME = require ( '@src/components/fx' ) . constants . HOVERMINTIME ;
26
23
27
24
describe ( 'zoom box element' , function ( ) {
28
25
var mock = require ( '@mocks/14.json' ) ;
@@ -2292,7 +2289,7 @@ describe('Cartesian plots with css transforms', function() {
2292
2289
function _dragRelease ( start , end ) {
2293
2290
var localEnd = _getLocalPos ( gd , end ) ;
2294
2291
_drag ( start , end ) ;
2295
- mouseEvent ( 'mouseup' , localEnd [ 0 ] , localEnd [ 1 ] ) ;
2292
+ mouseEvent ( 'mouseup' , localEnd [ 0 ] , localEnd [ 1 ] ) ;
2296
2293
}
2297
2294
2298
2295
function _hover ( pos ) {
@@ -2333,9 +2330,7 @@ describe('Cartesian plots with css transforms', function() {
2333
2330
var transforms = [ 'scale(0.5)' ] ;
2334
2331
2335
2332
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 ) {
2339
2334
function _hoverAndAssertEventOccurred ( point , label ) {
2340
2335
return _hover ( point )
2341
2336
. then ( function ( ) {
@@ -2345,7 +2340,7 @@ describe('Cartesian plots with css transforms', function() {
2345
2340
_unhover ( point ) ;
2346
2341
} ) ;
2347
2342
}
2348
-
2343
+
2349
2344
Plotly . plot ( gd , Lib . extendDeep ( { } , mock ) )
2350
2345
. then ( function ( ) {
2351
2346
gd . on ( 'plotly_hover' , function ( d ) {
@@ -2362,9 +2357,8 @@ describe('Cartesian plots with css transforms', function() {
2362
2357
. catch ( failTest )
2363
2358
. then ( done ) ;
2364
2359
} ) ;
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 ) {
2368
2362
// return a rect of form {left, top, width, height} from the zoomlayer
2369
2363
// svg path.
2370
2364
function _getZoomlayerPathRect ( pathStr ) {
@@ -2376,7 +2370,7 @@ describe('Cartesian plots with css transforms', function() {
2376
2370
rect . top = Number ( startCoordsString . split ( ',' ) [ 1 ] ) ;
2377
2371
return rect ;
2378
2372
}
2379
-
2373
+
2380
2374
// asserts that the zoombox path must go from the start to end positions,
2381
2375
// in css-transformed coordinates.
2382
2376
function _assertTransformedZoombox ( startPos , endPos ) {
@@ -2390,41 +2384,41 @@ describe('Cartesian plots with css transforms', function() {
2390
2384
expect ( zoomboxRect . width ) . toBeCloseTo ( size [ 0 ] ) ;
2391
2385
expect ( zoomboxRect . height ) . toBeCloseTo ( size [ 1 ] ) ;
2392
2386
}
2393
-
2387
+
2394
2388
var start = [ 50 , 50 ] ;
2395
- var end = [ 150 , 150 ]
2396
-
2389
+ var end = [ 150 , 150 ] ;
2390
+
2397
2391
Plotly . plot ( gd , Lib . extendDeep ( { } , mock ) )
2398
2392
. then ( function ( ) {
2399
2393
transformPlot ( gd , transform ) ;
2400
2394
recalculateInverse ( gd ) ;
2401
2395
} )
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 ) ;
2405
2399
} )
2406
2400
. then ( function ( ) { mouseEvent ( 'mouseup' , 0 , 0 ) ; } )
2407
2401
. catch ( failTest )
2408
2402
. then ( done ) ;
2409
2403
} ) ;
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 ) {
2413
2406
function _assertSelected ( expectation ) {
2414
2407
var data = gd . _fullData [ 0 ] ;
2415
2408
var points = data . selectedpoints ;
2416
2409
expect ( typeof ( points ) !== 'undefined' ) . toBeTrue ( ) ;
2417
- if ( expectation . numPoints )
2410
+ if ( expectation . numPoints ) {
2418
2411
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 ] ; } ) ;
2421
2415
expect ( selectedLabels ) . toEqual ( expectation . selectedLabels ) ;
2422
2416
}
2423
2417
}
2424
-
2418
+
2425
2419
var start = [ 10 , 10 ] ;
2426
2420
var end = [ 200 , 200 ] ;
2427
-
2421
+
2428
2422
Plotly . plot ( gd , Lib . extendDeep ( { } , mock ) )
2429
2423
. then ( function ( ) {
2430
2424
transformPlot ( gd , transform ) ;
@@ -2437,11 +2431,10 @@ describe('Cartesian plots with css transforms', function() {
2437
2431
_dragRelease ( start , end ) ;
2438
2432
} )
2439
2433
. then ( function ( ) {
2440
- _assertSelected ( { numPoints : 2 , selectedLabels : [ " one" , " two" ] } ) ;
2434
+ _assertSelected ( { numPoints : 2 , selectedLabels : [ ' one' , ' two' ] } ) ;
2441
2435
} )
2442
2436
. catch ( failTest )
2443
2437
. then ( done ) ;
2444
2438
} ) ;
2445
2439
} ) ;
2446
-
2447
- } ) ;
2440
+ } ) ;
0 commit comments