Skip to content

Commit f1b686f

Browse files
committed
test: assert up to yyyy-mm-dd for date ranges
- looks like the CI machine has less precision than my laptop
1 parent c45338d commit f1b686f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/jasmine/tests/modebar_test.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,15 @@ describe('ModeBar', function() {
624624
var PRECISION = 2;
625625

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

629-
expect(actual).toBeCloseToArray(expected.map(ax.r2l), PRECISION, axName);
629+
if(ax.type === 'date') {
630+
var truncate = function(v) { return v.substr(0, 10); };
631+
expect(actual.map(truncate)).toEqual(expected.map(truncate), axName);
632+
}
633+
else {
634+
expect(actual).toBeCloseToArray(expected, PRECISION, axName);
635+
}
630636
}
631637

632638
function assertActive(buttons, activeButton) {

0 commit comments

Comments
 (0)