@@ -2422,6 +2422,12 @@ describe('Cartesian plots with css transforms', function() {
2422
2422
}
2423
2423
} ;
2424
2424
2425
+ var bbox = {
2426
+ one : { x0 : 20 , x1 : 180 , y0 : 273.33 , y1 : 273.33 } ,
2427
+ two : { x0 : 220 , x1 : 380 , y0 : 146.67 , y1 : 146.67 } ,
2428
+ three : { x0 : 420 , x1 : 580 , y0 : 20 , y1 : 20 }
2429
+ } ;
2430
+
2425
2431
[ {
2426
2432
transform : 'scaleX(0.5)' ,
2427
2433
hovered : 1 ,
@@ -2436,12 +2442,14 @@ describe('Cartesian plots with css transforms', function() {
2436
2442
selected : { numPoints : 3 , selectedLabels : [ 'one' , 'two' , 'three' ] }
2437
2443
} ] . forEach ( function ( t ) {
2438
2444
var transform = t . transform ;
2439
-
2440
2445
it ( 'hover behaves correctly after css transform: ' + transform , function ( done ) {
2446
+ var _bboxRecordings = { } ;
2447
+
2441
2448
function _hoverAndAssertEventOccurred ( point , label ) {
2442
2449
return _hover ( point )
2443
2450
. then ( function ( ) {
2444
2451
expect ( eventRecordings [ label ] ) . toBe ( t . hovered ) ;
2452
+ expect ( _bboxRecordings [ label ] ) . toEqual ( bbox [ label ] ) ;
2445
2453
} )
2446
2454
. then ( function ( ) {
2447
2455
_unhover ( point ) ;
@@ -2454,6 +2462,7 @@ describe('Cartesian plots with css transforms', function() {
2454
2462
2455
2463
gd . on ( 'plotly_hover' , function ( d ) {
2456
2464
eventRecordings [ d . points [ 0 ] . x ] = 1 ;
2465
+ _bboxRecordings [ d . points [ 0 ] . x ] = d . points [ 0 ] . bbox ;
2457
2466
} ) ;
2458
2467
} )
2459
2468
. then ( function ( ) { _hoverAndAssertEventOccurred ( points [ 0 ] , xLabels [ 0 ] ) ; } )
0 commit comments