@@ -1085,7 +1085,20 @@ describe('@gl parcoords constraint interactions', function() {
1085
1085
} ;
1086
1086
}
1087
1087
1088
- afterAll ( purgeGraphDiv ) ;
1088
+ var parcoordsConstants = require ( '@src/traces/parcoords/constants' ) ;
1089
+ var initialSnapDuration ;
1090
+ var shortenedSnapDuration = 20 ;
1091
+ var snapDelay = 100 ;
1092
+ var noSnapDelay = 20 ;
1093
+ beforeAll ( function ( ) {
1094
+ initialSnapDuration = parcoordsConstants . bar . snapDuration ;
1095
+ parcoordsConstants . bar . snapDuration = shortenedSnapDuration ;
1096
+ } ) ;
1097
+
1098
+ afterAll ( function ( ) {
1099
+ purgeGraphDiv ( ) ;
1100
+ parcoordsConstants . bar . snapDuration = initialSnapDuration ;
1101
+ } ) ;
1089
1102
1090
1103
beforeEach ( function ( done ) {
1091
1104
var hasGD = ! ! gd ;
@@ -1139,7 +1152,7 @@ describe('@gl parcoords constraint interactions', function() {
1139
1152
checkDashCount ( newDashArray , 1 ) ;
1140
1153
1141
1154
mouseEvent ( 'mouseup' , 105 , 190 ) ;
1142
- delay ( 300 ) ( ) . then ( function ( ) {
1155
+ delay ( snapDelay ) ( ) . then ( function ( ) {
1143
1156
expect ( getDashArray ( 0 ) ) . toBe ( initialDashArray0 ) ;
1144
1157
expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toBeCloseToArray ( [ 2.75 , 4 ] ) ;
1145
1158
@@ -1150,7 +1163,7 @@ describe('@gl parcoords constraint interactions', function() {
1150
1163
1151
1164
mouseEvent ( 'mouseup' , 105 , 240 ) ;
1152
1165
} )
1153
- . then ( delay ( 300 ) )
1166
+ . then ( delay ( snapDelay ) )
1154
1167
. then ( function ( ) {
1155
1168
expect ( getDashArray ( 0 ) ) . toBe ( initialDashArray0 ) ;
1156
1169
expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toBeCloseToArray ( [ 2.75 , 4 ] ) ;
@@ -1162,7 +1175,7 @@ describe('@gl parcoords constraint interactions', function() {
1162
1175
1163
1176
mouseEvent ( 'mouseup' , 105 , 260 ) ;
1164
1177
} )
1165
- . then ( delay ( 300 ) )
1178
+ . then ( delay ( snapDelay ) )
1166
1179
. then ( function ( ) {
1167
1180
newDashArray = getDashArray ( 0 ) ;
1168
1181
checkDashCount ( newDashArray , 2 ) ;
@@ -1175,7 +1188,7 @@ describe('@gl parcoords constraint interactions', function() {
1175
1188
1176
1189
mouseEvent ( 'mouseup' , 105 , 240 ) ;
1177
1190
} )
1178
- . then ( delay ( 300 ) )
1191
+ . then ( delay ( snapDelay ) )
1179
1192
. then ( function ( ) {
1180
1193
newDashArray = getDashArray ( 0 ) ;
1181
1194
checkDashCount ( newDashArray , 2 ) ;
@@ -1184,7 +1197,7 @@ describe('@gl parcoords constraint interactions', function() {
1184
1197
// clear the whole thing
1185
1198
click ( 105 , 290 ) ;
1186
1199
} )
1187
- . then ( delay ( 300 ) )
1200
+ . then ( delay ( snapDelay ) )
1188
1201
. then ( function ( ) {
1189
1202
checkDashCount ( getDashArray ( 0 ) , 0 ) ;
1190
1203
expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toBeUndefined ( ) ;
@@ -1201,7 +1214,7 @@ describe('@gl parcoords constraint interactions', function() {
1201
1214
checkDashCount ( newDashArray , 1 ) ;
1202
1215
1203
1216
mouseEvent ( 'mouseup' , 295 , 190 ) ;
1204
- delay ( 100 ) ( ) . then ( function ( ) {
1217
+ delay ( noSnapDelay ) ( ) . then ( function ( ) {
1205
1218
expect ( getDashArray ( 1 ) ) . toBe ( newDashArray ) ;
1206
1219
expect ( gd . data [ 0 ] . dimensions [ 1 ] . constraintrange ) . toBeCloseToArray ( [ 4.8959 , 9 ] ) ;
1207
1220
@@ -1212,7 +1225,7 @@ describe('@gl parcoords constraint interactions', function() {
1212
1225
1213
1226
mouseEvent ( 'mouseup' , 295 , 240 ) ;
1214
1227
} )
1215
- . then ( delay ( 100 ) )
1228
+ . then ( delay ( noSnapDelay ) )
1216
1229
. then ( function ( ) {
1217
1230
expect ( getDashArray ( 1 ) ) . toBe ( newDashArray ) ;
1218
1231
expect ( gd . data [ 0 ] . dimensions [ 1 ] . constraintrange ) . toBeCloseTo2DArray ( [ [ 0.7309 , 2.8134 ] , [ 4.8959 , 9 ] ] ) ;
@@ -1225,7 +1238,7 @@ describe('@gl parcoords constraint interactions', function() {
1225
1238
1226
1239
mouseEvent ( 'mouseup' , 295 , 260 ) ;
1227
1240
} )
1228
- . then ( delay ( 100 ) )
1241
+ . then ( delay ( noSnapDelay ) )
1229
1242
. then ( function ( ) {
1230
1243
expect ( getDashArray ( 1 ) ) . toBe ( newDashArray ) ;
1231
1244
// TODO: ideally this would get clipped to [0, 9]...
@@ -1249,7 +1262,7 @@ describe('@gl parcoords constraint interactions', function() {
1249
1262
1250
1263
mouseEvent ( 'mouseup' , 295 , 240 ) ;
1251
1264
} )
1252
- . then ( delay ( 100 ) )
1265
+ . then ( delay ( noSnapDelay ) )
1253
1266
. then ( function ( ) {
1254
1267
expect ( getDashArray ( 1 ) ) . toBe ( newDashArray ) ;
1255
1268
expect ( gd . data [ 0 ] . dimensions [ 1 ] . constraintrange ) . toBeCloseToArray ( [ 0.7309 , 2.8134 ] ) ;
@@ -1261,7 +1274,7 @@ describe('@gl parcoords constraint interactions', function() {
1261
1274
1262
1275
mouseEvent ( 'mouseup' , 105 , 260 ) ;
1263
1276
} )
1264
- . then ( delay ( 300 ) )
1277
+ . then ( delay ( snapDelay ) )
1265
1278
. then ( function ( ) {
1266
1279
var finalDashArray = getDashArray ( 0 ) ;
1267
1280
expect ( finalDashArray ) . not . toBe ( newDashArray ) ;
0 commit comments