@@ -63,7 +63,7 @@ describe('select box and lasso', function() {
63
63
. then ( done ) ;
64
64
} ) ;
65
65
66
- it ( 'should trigger events' , function ( done ) {
66
+ it ( 'should trigger selecting/selected/deselect events' , function ( done ) {
67
67
var selectingCnt = 0 ,
68
68
selectingData ;
69
69
gd . on ( 'plotly_selecting' , function ( data ) {
@@ -85,7 +85,7 @@ describe('select box and lasso', function() {
85
85
86
86
drag ( [ [ 100 , 200 ] , [ 150 , 200 ] ] ) ;
87
87
88
- expect ( selectingCnt ) . toEqual ( 1 ) ;
88
+ expect ( selectingCnt ) . toEqual ( 1 , 'with the correct selecting count' ) ;
89
89
expect ( selectingData . points ) . toEqual ( [ {
90
90
curveNumber : 0 ,
91
91
pointNumber : 0 ,
@@ -96,13 +96,13 @@ describe('select box and lasso', function() {
96
96
pointNumber : 1 ,
97
97
x : 0.004 ,
98
98
y : 12.5
99
- } ] ) ;
99
+ } ] , 'with the correct selecting points' ) ;
100
100
assertRange ( selectingData . range , {
101
101
x : [ 0.0019667582669138295 , 0.004546754982054625 ] ,
102
102
y : [ 0.10209191961595454 , 24.512223978291406 ]
103
- } ) ;
103
+ } , 'with the correct selecting range' ) ;
104
104
105
- expect ( selectedCnt ) . toEqual ( 1 ) ;
105
+ expect ( selectedCnt ) . toEqual ( 1 , 'with the correct selected count' ) ;
106
106
expect ( selectedData . points ) . toEqual ( [ {
107
107
curveNumber : 0 ,
108
108
pointNumber : 0 ,
@@ -113,14 +113,14 @@ describe('select box and lasso', function() {
113
113
pointNumber : 1 ,
114
114
x : 0.004 ,
115
115
y : 12.5
116
- } ] ) ;
116
+ } ] , 'with the correct selected points' ) ;
117
117
assertRange ( selectedData . range , {
118
118
x : [ 0.0019667582669138295 , 0.004546754982054625 ] ,
119
119
y : [ 0.10209191961595454 , 24.512223978291406 ]
120
- } ) ;
120
+ } , 'with the correct selected range' ) ;
121
121
122
122
doubleClick ( 250 , 200 , function ( ) {
123
- expect ( doubleClickData ) . toBe ( null ) ;
123
+ expect ( doubleClickData ) . toBe ( null , 'with the correct deselect data' ) ;
124
124
done ( ) ;
125
125
} ) ;
126
126
} ) ;
@@ -139,7 +139,7 @@ describe('select box and lasso', function() {
139
139
. then ( done ) ;
140
140
} ) ;
141
141
142
- it ( 'should trigger events' , function ( done ) {
142
+ it ( 'should trigger selecting/selected/deselect events' , function ( done ) {
143
143
var selectingCnt = 0 ,
144
144
selectingData ;
145
145
gd . on ( 'plotly_selecting' , function ( data ) {
@@ -161,24 +161,24 @@ describe('select box and lasso', function() {
161
161
162
162
drag ( [ [ 331 , 178 ] , [ 333 , 246 ] , [ 350 , 250 ] , [ 343 , 176 ] ] ) ;
163
163
164
- expect ( selectingCnt ) . toEqual ( 3 ) ;
164
+ expect ( selectingCnt ) . toEqual ( 3 , 'with the correct selecting count' ) ;
165
165
expect ( selectingData . points ) . toEqual ( [ {
166
166
curveNumber : 0 ,
167
167
pointNumber : 10 ,
168
168
x : 0.099 ,
169
169
y : 2.75
170
- } ] ) ;
170
+ } ] , 'with the correct selecting points' ) ;
171
171
172
- expect ( selectedCnt ) . toEqual ( 1 ) ;
172
+ expect ( selectedCnt ) . toEqual ( 1 , 'with the correct selected count' ) ;
173
173
expect ( selectedData . points ) . toEqual ( [ {
174
174
curveNumber : 0 ,
175
175
pointNumber : 10 ,
176
176
x : 0.099 ,
177
177
y : 2.75
178
- } ] ) ;
178
+ } ] , 'with the correct selected points' ) ;
179
179
180
180
doubleClick ( 250 , 200 , function ( ) {
181
- expect ( doubleClickData ) . toBe ( null ) ;
181
+ expect ( doubleClickData ) . toBe ( null , 'with the correct deselect data' ) ;
182
182
done ( ) ;
183
183
} ) ;
184
184
} ) ;
0 commit comments