@@ -11,6 +11,7 @@ var createGraphDiv = require('../assets/create_graph_div');
11
11
var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
12
12
var mouseEvent = require ( '../assets/mouse_event' ) ;
13
13
var supplyAllDefaults = require ( '../assets/supply_defaults' ) ;
14
+ var failTest = require ( '../assets/fail_test' ) ;
14
15
15
16
var TOL = 6 ;
16
17
@@ -95,7 +96,9 @@ describe('the range slider', function() {
95
96
expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 4 , 49 ] , - 0.5 ) ;
96
97
expect ( maskMin . getAttribute ( 'width' ) ) . toEqual ( String ( diff ) ) ;
97
98
expect ( handleMin . getAttribute ( 'transform' ) ) . toBe ( 'translate(' + ( diff - 2.5 ) + ',0.5)' ) ;
98
- } ) . then ( done ) ;
99
+ } )
100
+ . catch ( failTest )
101
+ . then ( done ) ;
99
102
} ) ;
100
103
101
104
it ( 'should react to resizing the maximum handle' , function ( done ) {
@@ -114,7 +117,9 @@ describe('the range slider', function() {
114
117
expect ( + maskMax . getAttribute ( 'width' ) ) . toBeCloseTo ( - diff ) ;
115
118
116
119
testTranslate1D ( handleMax , dataMaxStart + diff ) ;
117
- } ) . then ( done ) ;
120
+ } )
121
+ . catch ( failTest )
122
+ . then ( done ) ;
118
123
} ) ;
119
124
120
125
it ( 'should react to moving the slidebox left to right' , function ( done ) {
@@ -132,7 +137,9 @@ describe('the range slider', function() {
132
137
expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 3.96 , 49 ] , - 0.5 ) ;
133
138
expect ( + maskMin . getAttribute ( 'width' ) ) . toBeCloseTo ( String ( diff ) ) ;
134
139
testTranslate1D ( handleMin , dataMinStart + diff - 3 ) ;
135
- } ) . then ( done ) ;
140
+ } )
141
+ . catch ( failTest )
142
+ . then ( done ) ;
136
143
} ) ;
137
144
138
145
it ( 'should react to moving the slidebox right to left' , function ( done ) {
@@ -150,7 +157,9 @@ describe('the range slider', function() {
150
157
expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 0 , 45.04 ] , - 0.5 ) ;
151
158
expect ( + maskMax . getAttribute ( 'width' ) ) . toBeCloseTo ( - diff ) ;
152
159
testTranslate1D ( handleMax , dataMaxStart + diff ) ;
153
- } ) . then ( done ) ;
160
+ } )
161
+ . catch ( failTest )
162
+ . then ( done ) ;
154
163
} ) ;
155
164
156
165
it ( 'should resize the main plot when rangeslider has moved' , function ( done ) {
@@ -186,6 +195,7 @@ describe('the range slider', function() {
186
195
testTranslate1D ( handleMin , 123.32 ) ;
187
196
testTranslate1D ( handleMax , 252.65 ) ;
188
197
} )
198
+ . catch ( failTest )
189
199
. then ( done ) ;
190
200
} ) ;
191
201
@@ -201,6 +211,7 @@ describe('the range slider', function() {
201
211
testTranslate1D ( handleMin , 123.32 ) ;
202
212
testTranslate1D ( handleMax , 617 ) ;
203
213
} )
214
+ . catch ( failTest )
204
215
. then ( done ) ;
205
216
} ) ;
206
217
0 commit comments