@@ -237,18 +237,24 @@ describe('Test relayout on polar subplots:', function() {
237237 Plotly . plot ( gd , fig ) . then ( function ( ) {
238238 expect ( gd . _fullLayout . polar . _subplot . viewInitial [ 'radialaxis.range' ] )
239239 . toBeCloseToArray ( [ 0 , 11.225 ] ) ;
240+ expect ( gd . _fullLayout . polar . radialaxis . range )
241+ . toBeCloseToArray ( [ 0 , 11.225 ] ) ;
240242
241243 return Plotly . relayout ( gd , 'polar.radialaxis.type' , 'log' ) ;
242244 } )
243245 . then ( function ( ) {
244246 expect ( gd . _fullLayout . polar . _subplot . viewInitial [ 'radialaxis.range' ] )
245247 . toBeCloseToArray ( [ - 0.53 , 1.158 ] ) ;
248+ expect ( gd . _fullLayout . polar . radialaxis . range )
249+ . toBeCloseToArray ( [ - 0.53 , 1.158 ] ) ;
246250
247251 return Plotly . relayout ( gd , 'polar.radialaxis.type' , 'linear' ) ;
248252 } )
249253 . then ( function ( ) {
250254 expect ( gd . _fullLayout . polar . _subplot . viewInitial [ 'radialaxis.range' ] )
251255 . toBeCloseToArray ( [ 0 , 11.225 ] ) ;
256+ expect ( gd . _fullLayout . polar . radialaxis . range )
257+ . toBeCloseToArray ( [ 0 , 11.225 ] ) ;
252258 } )
253259 . catch ( fail )
254260 . then ( done ) ;
@@ -570,10 +576,10 @@ describe('Test polar interactions:', function() {
570576 mouseEvent ( 'mouseout' , pos [ 0 ] , pos [ 1 ] ) ;
571577 }
572578
573- function _click ( pos ) {
579+ function _click ( pos , opts ) {
574580 eventData = '' ;
575581 gd . _mouseDownTime = 0 ;
576- click ( pos [ 0 ] , pos [ 1 ] ) ;
582+ click ( pos [ 0 ] , pos [ 1 ] , opts ) ;
577583 }
578584
579585 function _doubleClick ( pos ) {
@@ -582,6 +588,24 @@ describe('Test polar interactions:', function() {
582588 return doubleClick ( pos [ 0 ] , pos [ 1 ] ) ;
583589 }
584590
591+ var modClickOpts = {
592+ altKey : true ,
593+ ctrlKey : true , // this makes it effectively into a right-click
594+ metaKey : true ,
595+ shiftKey : true ,
596+ button : 0 ,
597+ cancelContext : true
598+ } ;
599+
600+ var rightClickOpts = {
601+ altKey : false ,
602+ ctrlKey : false ,
603+ metaKey : false ,
604+ shiftKey : false ,
605+ button : 2 ,
606+ cancelContext : true
607+ } ;
608+
585609 it ( 'should trigger hover/unhover/click/doubleclick events' , function ( done ) {
586610 var fig = Lib . extendDeep ( { } , require ( '@mocks/polar_scatter.json' ) ) ;
587611 var ptPos = [ 250 , 200 ] ;
@@ -645,6 +669,32 @@ describe('Test polar interactions:', function() {
645669 plotly_relayout : 1
646670 } , 'after doubleclick' ) ;
647671 } )
672+ . then ( function ( ) { _click ( ptPos , modClickOpts ) ; } )
673+ . then ( function ( ) {
674+ _assert ( [ {
675+ r : 3.26 ,
676+ theta : 68.08
677+ } ] , {
678+ plotly_hover : 2 ,
679+ plotly_unhover : 1 ,
680+ plotly_click : 4 ,
681+ plotly_doubleclick : 1 ,
682+ plotly_relayout : 1
683+ } , 'after modified click' ) ;
684+ } )
685+ . then ( function ( ) { _click ( ptPos , rightClickOpts ) ; } )
686+ . then ( function ( ) {
687+ _assert ( [ {
688+ r : 3.26 ,
689+ theta : 68.08
690+ } ] , {
691+ plotly_hover : 2 ,
692+ plotly_unhover : 1 ,
693+ plotly_click : 5 ,
694+ plotly_doubleclick : 1 ,
695+ plotly_relayout : 1
696+ } , 'after right click' ) ;
697+ } )
648698 . catch ( fail )
649699 . then ( done ) ;
650700 } ) ;
0 commit comments