Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c45338d

Browse files
committedNov 17, 2016
test: use ax.r2l to assert range
- so that date axis ranges can be tested with some tolerance
1 parent 8e9d458 commit c45338d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed
 

‎test/jasmine/tests/modebar_test.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
var d3 = require('d3');
2-
var isNumeric = require('fast-isnumeric');
32

43
var createModeBar = require('@src/components/modebar/modebar');
54
var manageModeBar = require('@src/components/modebar/manage');
@@ -624,12 +623,10 @@ describe('ModeBar', function() {
624623
function assertRange(axName, expected) {
625624
var PRECISION = 2;
626625

627-
var actual = gd._fullLayout[axName].range;
626+
var ax = gd._fullLayout[axName];
627+
var actual = ax.range.map(ax.r2l);
628628

629-
if(isNumeric(expected[0])) {
630-
expect(actual).toBeCloseToArray(expected, PRECISION, axName);
631-
}
632-
else expect(actual).toEqual(expected, axName);
629+
expect(actual).toBeCloseToArray(expected.map(ax.r2l), PRECISION, axName);
633630
}
634631

635632
function assertActive(buttons, activeButton) {

0 commit comments

Comments
 (0)
Please sign in to comment.