@@ -27,7 +27,7 @@ describe('the range slider', function() {
27
27
function testTranslate1D ( node , val ) {
28
28
var transformParts = node . getAttribute ( 'transform' ) . split ( '(' ) ;
29
29
expect ( transformParts [ 0 ] ) . toEqual ( 'translate' ) ;
30
- expect ( + transformParts [ 1 ] . split ( ',0)' ) [ 0 ] ) . toBeCloseTo ( val , 0 ) ;
30
+ expect ( + transformParts [ 1 ] . split ( ',0)' ) [ 0 ] ) . toBeCloseTo ( val , - 1 ) ;
31
31
}
32
32
33
33
describe ( 'when specified as visible' , function ( ) {
@@ -85,7 +85,7 @@ describe('the range slider', function() {
85
85
var maskMin = children [ 2 ] ,
86
86
handleMin = children [ 5 ] ;
87
87
88
- expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 4.35 , 49 ] ) ;
88
+ expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 4 , 49 ] , - 0.5 ) ;
89
89
expect ( maskMin . getAttribute ( 'width' ) ) . toEqual ( String ( diff ) ) ;
90
90
expect ( handleMin . getAttribute ( 'transform' ) ) . toBe ( 'translate(' + ( diff - 3 ) + ',0)' ) ;
91
91
} ) . then ( done ) ;
@@ -103,7 +103,7 @@ describe('the range slider', function() {
103
103
var maskMax = children [ 3 ] ,
104
104
handleMax = children [ 6 ] ;
105
105
106
- expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 0 , 32.77 ] ) ;
106
+ expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 0 , 32.77 ] , - 0.5 ) ;
107
107
expect ( + maskMax . getAttribute ( 'width' ) ) . toBeCloseTo ( - diff ) ;
108
108
109
109
testTranslate1D ( handleMax , dataMaxStart + diff ) ;
@@ -122,7 +122,7 @@ describe('the range slider', function() {
122
122
var maskMin = children [ 2 ] ,
123
123
handleMin = children [ 5 ] ;
124
124
125
- expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 3.96 , 49 ] ) ;
125
+ expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 3.96 , 49 ] , - 0.5 ) ;
126
126
expect ( + maskMin . getAttribute ( 'width' ) ) . toBeCloseTo ( String ( diff ) ) ;
127
127
testTranslate1D ( handleMin , dataMinStart + diff - 3 ) ;
128
128
} ) . then ( done ) ;
@@ -140,7 +140,7 @@ describe('the range slider', function() {
140
140
var maskMax = children [ 3 ] ,
141
141
handleMax = children [ 6 ] ;
142
142
143
- expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 0 , 45.04 ] ) ;
143
+ expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( [ 0 , 45.04 ] , - 0.5 ) ;
144
144
expect ( + maskMax . getAttribute ( 'width' ) ) . toBeCloseTo ( - diff ) ;
145
145
testTranslate1D ( handleMax , dataMaxStart + diff ) ;
146
146
} ) . then ( done ) ;
@@ -174,8 +174,8 @@ describe('the range slider', function() {
174
174
handleMin = children [ 5 ] ,
175
175
handleMax = children [ 6 ] ;
176
176
177
- expect ( + maskMin . getAttribute ( 'width' ) ) . toBeCloseTo ( 126.32 , 0 ) ;
178
- expect ( + maskMax . getAttribute ( 'width' ) ) . toBeCloseTo ( 366.34 , 0 ) ;
177
+ expect ( + maskMin . getAttribute ( 'width' ) ) . toBeCloseTo ( 126.32 , - 0.5 ) ;
178
+ expect ( + maskMax . getAttribute ( 'width' ) ) . toBeCloseTo ( 366.34 , - 0.5 ) ;
179
179
testTranslate1D ( handleMin , 123.32 ) ;
180
180
testTranslate1D ( handleMax , 252.65 ) ;
181
181
} )
@@ -247,7 +247,7 @@ describe('the range slider', function() {
247
247
248
248
Plotly . relayout ( gd , 'xaxis.range' , [ 5 , 10 ] ) . then ( function ( ) {
249
249
expect ( + maskMin . getAttribute ( 'width' ) ) . toBeCloseTo ( 63.16 , 0 ) ;
250
- expect ( + maskMax . getAttribute ( 'width' ) ) . toBeCloseTo ( 492.67 , 0 ) ;
250
+ expect ( + maskMax . getAttribute ( 'width' ) ) . toBeCloseTo ( 492.67 , - 1 ) ;
251
251
252
252
return Plotly . relayout ( gd , 'xaxis.domain' , [ 0.3 , 0.7 ] ) ;
253
253
} )
@@ -256,7 +256,7 @@ describe('the range slider', function() {
256
256
maskMax = children [ 3 ] ;
257
257
258
258
expect ( + maskMin . getAttribute ( 'width' ) ) . toBeCloseTo ( 25.26 , 0 ) ;
259
- expect ( + maskMax . getAttribute ( 'width' ) ) . toBeCloseTo ( 197.06 , 0 ) ;
259
+ expect ( + maskMax . getAttribute ( 'width' ) ) . toBeCloseTo ( 197.06 , - 1 ) ;
260
260
261
261
return Plotly . relayout ( gd , 'width' , 400 ) ;
262
262
} )
0 commit comments