Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e45142d

Browse files
committed
add tolerance
1 parent 92b606b commit e45142d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/jasmine/tests/hover_spikeline_test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ describe('spikeline', function() {
3939
}
4040

4141
function _assert(lineExpect, circleExpect) {
42+
var TOL = 5;
4243
var lines = d3.selectAll('line.spikeline');
4344
var circles = d3.selectAll('circle.spikeline');
4445

@@ -49,15 +50,15 @@ describe('spikeline', function() {
4950
var sel = d3.select(this);
5051
['x1', 'y1', 'x2', 'y2'].forEach(function(d, j) {
5152
expect(sel.attr(d))
52-
.toBeWithin(lineExpect[i][j], 1, 'line ' + i + ' attr ' + d);
53+
.toBeWithin(lineExpect[i][j], TOL, 'line ' + i + ' attr ' + d);
5354
});
5455
});
5556

5657
circles.each(function(_, i) {
5758
var sel = d3.select(this);
5859
['cx', 'cy'].forEach(function(d, j) {
5960
expect(sel.attr(d))
60-
.toBeWithin(circleExpect[i][j], 1, 'circle ' + i + ' attr ' + d);
61+
.toBeWithin(circleExpect[i][j], TOL, 'circle ' + i + ' attr ' + d);
6162
});
6263
});
6364
}

0 commit comments

Comments
 (0)