Skip to content

Commit c0ca4f5

Browse files
committed
test: add a little tolerance for FF
1 parent 1d7b066 commit c0ca4f5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/jasmine/tests/range_slider_test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('the range slider', function() {
2727
function testTranslate1D(node, val) {
2828
var transformParts = node.getAttribute('transform').split('(');
2929
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);
3131
}
3232

3333
describe('when specified as visible', function() {
@@ -85,7 +85,7 @@ describe('the range slider', function() {
8585
var maskMin = children[2],
8686
handleMin = children[5];
8787

88-
expect(gd.layout.xaxis.range).toBeCloseToArray([4.35, 49]);
88+
expect(gd.layout.xaxis.range).toBeCloseToArray([4, 49], -0.5);
8989
expect(maskMin.getAttribute('width')).toEqual(String(diff));
9090
expect(handleMin.getAttribute('transform')).toBe('translate(' + (diff - 3) + ',0)');
9191
}).then(done);
@@ -103,7 +103,7 @@ describe('the range slider', function() {
103103
var maskMax = children[3],
104104
handleMax = children[6];
105105

106-
expect(gd.layout.xaxis.range).toBeCloseToArray([0, 32.77]);
106+
expect(gd.layout.xaxis.range).toBeCloseToArray([0, 32.77], -0.5);
107107
expect(+maskMax.getAttribute('width')).toBeCloseTo(-diff);
108108

109109
testTranslate1D(handleMax, dataMaxStart + diff);
@@ -122,7 +122,7 @@ describe('the range slider', function() {
122122
var maskMin = children[2],
123123
handleMin = children[5];
124124

125-
expect(gd.layout.xaxis.range).toBeCloseToArray([3.96, 49]);
125+
expect(gd.layout.xaxis.range).toBeCloseToArray([3.96, 49], -0.5);
126126
expect(+maskMin.getAttribute('width')).toBeCloseTo(String(diff));
127127
testTranslate1D(handleMin, dataMinStart + diff - 3);
128128
}).then(done);
@@ -140,7 +140,7 @@ describe('the range slider', function() {
140140
var maskMax = children[3],
141141
handleMax = children[6];
142142

143-
expect(gd.layout.xaxis.range).toBeCloseToArray([0, 45.04]);
143+
expect(gd.layout.xaxis.range).toBeCloseToArray([0, 45.04], -0.5);
144144
expect(+maskMax.getAttribute('width')).toBeCloseTo(-diff);
145145
testTranslate1D(handleMax, dataMaxStart + diff);
146146
}).then(done);
@@ -174,8 +174,8 @@ describe('the range slider', function() {
174174
handleMin = children[5],
175175
handleMax = children[6];
176176

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);
179179
testTranslate1D(handleMin, 123.32);
180180
testTranslate1D(handleMax, 252.65);
181181
})
@@ -247,7 +247,7 @@ describe('the range slider', function() {
247247

248248
Plotly.relayout(gd, 'xaxis.range', [5, 10]).then(function() {
249249
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);
251251

252252
return Plotly.relayout(gd, 'xaxis.domain', [0.3, 0.7]);
253253
})
@@ -256,7 +256,7 @@ describe('the range slider', function() {
256256
maskMax = children[3];
257257

258258
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);
260260

261261
return Plotly.relayout(gd, 'width', 400);
262262
})

0 commit comments

Comments
 (0)