@@ -151,20 +151,24 @@ describe('annotations autosize', function() {
151
151
// xaxis2 need a bit more tolerance to pass on CI
152
152
// this most likely due to the different text bounding box values
153
153
// on headfull vs headless browsers.
154
- var PREC2 = 0.1 ;
154
+ // but also because it's a date axis that we've converted to ms
155
+ var PRECX2 = - 10 ;
156
+ // yaxis2 needs a bit more now too...
157
+ var PRECY2 = 0.2 ;
158
+ var dateAx = fullLayout . xaxis2 ;
155
159
156
160
expect ( fullLayout . xaxis . range ) . toBeCloseToArray ( x , PREC , '- xaxis' ) ;
157
161
expect ( fullLayout . yaxis . range ) . toBeCloseToArray ( y , PREC , '- yaxis' ) ;
158
- expect ( fullLayout . xaxis2 . range ) . toBeCloseToArray ( x2 , PREC2 , 'xaxis2' ) ;
159
- expect ( fullLayout . yaxis2 . range ) . toBeCloseToArray ( y2 , PREC , 'yaxis2' ) ;
162
+ expect ( dateAx . range . map ( dateAx . r2l ) ) . toBeCloseToArray ( x2 . map ( dateAx . r2l ) , PRECX2 , 'xaxis2 ' + dateAx . range ) ;
163
+ expect ( fullLayout . yaxis2 . range ) . toBeCloseToArray ( y2 , PRECY2 , 'yaxis2' ) ;
160
164
expect ( fullLayout . xaxis3 . range ) . toBeCloseToArray ( x3 , PREC , 'xaxis3' ) ;
161
165
expect ( fullLayout . yaxis3 . range ) . toBeCloseToArray ( y3 , PREC , 'yaxis3' ) ;
162
166
}
163
167
164
168
Plotly . plot ( gd , mock ) . then ( function ( ) {
165
169
assertRanges (
166
170
[ 0.97 , 2.03 ] , [ 0.97 , 2.03 ] ,
167
- [ - 0.32 , 3.38 ] , [ 0.42 , 2.58 ] ,
171
+ [ '2000-10-01 08:23:18.0583' , '2001-06-05 19:20:23.301' ] , [ - 0.245 , 4.245 ] ,
168
172
[ 0.9 , 2.1 ] , [ 0.86 , 2.14 ]
169
173
) ;
170
174
@@ -177,7 +181,7 @@ describe('annotations autosize', function() {
177
181
. then ( function ( ) {
178
182
assertRanges (
179
183
[ 1.44 , 2.02 ] , [ 0.97 , 2.03 ] ,
180
- [ 1.31 , 2.41 ] , [ 0.42 , 2.58 ] ,
184
+ [ '2001-01-18 15:06:04.0449' , '2001-03-27 14:01:20.8989' ] , [ - 0.245 , 4.245 ] ,
181
185
[ 1.44 , 2.1 ] , [ 0.86 , 2.14 ]
182
186
) ;
183
187
@@ -190,7 +194,7 @@ describe('annotations autosize', function() {
190
194
. then ( function ( ) {
191
195
assertRanges (
192
196
[ 1.44 , 2.02 ] , [ 0.99 , 1.52 ] ,
193
- [ 0.5 , 2.5 ] , [ 0.42 , 2.58 ] ,
197
+ [ '2001-01-31 23:59:59.999' , '2001-02-01 00:00:00.001' ] , [ - 0.245 , 4.245 ] ,
194
198
[ 0.5 , 2.5 ] , [ 0.86 , 2.14 ]
195
199
) ;
196
200
@@ -206,7 +210,7 @@ describe('annotations autosize', function() {
206
210
. then ( function ( ) {
207
211
assertRanges (
208
212
[ 0.97 , 2.03 ] , [ 0.97 , 2.03 ] ,
209
- [ - 0.32 , 3.38 ] , [ 0.42 , 2.58 ] ,
213
+ [ '2000-10-01 08:23:18.0583' , '2001-06-05 19:20:23.301' ] , [ - 0.245 , 4.245 ] ,
210
214
[ 0.9 , 2.1 ] , [ 0.86 , 2.14 ]
211
215
) ;
212
216
} )
0 commit comments