@@ -102,6 +102,38 @@ describe('click interactions', function() {
102
102
} ) ;
103
103
} ) ;
104
104
105
+ describe ( 'click events with hovermode set to false' , function ( ) {
106
+ var futureData ;
107
+
108
+ beforeEach ( function ( done ) {
109
+ gd = createGraphDiv ( ) ;
110
+
111
+ var mockCopy = Lib . extendDeep ( { } , mock ) ;
112
+ Plotly . plot ( gd , mockCopy . data , Lib . extendDeep ( { } , mockCopy . layout , { hovermode : false } ) )
113
+ . then ( done ) ;
114
+
115
+ gd . on ( 'plotly_click' , function ( data ) {
116
+ futureData = data ;
117
+ } ) ;
118
+ } ) ;
119
+
120
+ it ( 'should contain the correct fields despite hovermode: false' , function ( ) {
121
+ click ( pointPos [ 0 ] , pointPos [ 1 ] ) ;
122
+ expect ( futureData . points . length ) . toEqual ( 1 ) ;
123
+
124
+ var pt = futureData . points [ 0 ] ;
125
+ expect ( Object . keys ( pt ) ) . toEqual ( [
126
+ 'data' , 'fullData' , 'curveNumber' , 'pointNumber' ,
127
+ 'x' , 'y' , 'xaxis' , 'yaxis'
128
+ ] ) ;
129
+ expect ( pt . curveNumber ) . toEqual ( 0 ) ;
130
+ expect ( pt . pointNumber ) . toEqual ( 11 ) ;
131
+ expect ( pt . x ) . toEqual ( 0.125 ) ;
132
+ expect ( pt . y ) . toEqual ( 2.125 ) ;
133
+
134
+ } ) ;
135
+ } ) ;
136
+
105
137
describe ( 'double click events' , function ( ) {
106
138
var futureData ;
107
139
0 commit comments