Skip to content

Commit 3dd294f

Browse files
committed
fix for range slider tests with new axis range machinery
1 parent c045bc5 commit 3dd294f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/jasmine/tests/range_slider_test.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var Plotly = require('@lib/index');
22
var Lib = require('@src/lib');
3+
var setConvert = require('@src/plots/cartesian/set_convert');
34

45
var RangeSlider = require('@src/components/rangeslider');
56
var constants = require('@src/components/rangeslider/constants');
@@ -473,7 +474,7 @@ describe('the range slider', function() {
473474

474475
it('should expand the rangeslider range to axis range', function() {
475476
var layoutIn = { xaxis: { rangeslider: { range: [5, 6] } }, yaxis: {}},
476-
layoutOut = { xaxis: { range: [1, 10]}, yaxis: {}},
477+
layoutOut = { xaxis: { range: [1, 10], type: 'linear'}, yaxis: {}},
477478
axName = 'xaxis',
478479
counterAxes = ['yaxis'],
479480
expected = {
@@ -491,10 +492,14 @@ describe('the range slider', function() {
491492
},
492493
yaxis: { fixedrange: true }
493494
};
495+
setConvert(layoutOut.xaxis);
494496

495497
RangeSlider.handleDefaults(layoutIn, layoutOut, axName, counterAxes);
496498

497-
expect(layoutOut).toEqual(expected);
499+
// don't compare the whole layout, because we had to run setConvert which
500+
// attaches all sorts of other stuff to xaxis
501+
expect(layoutOut.xaxis.rangeslider).toEqual(expected.xaxis.rangeslider);
502+
expect(layoutOut.yaxis).toEqual(expected.yaxis);
498503
});
499504

500505
it('should set _needsExpand when an axis range is set', function() {

0 commit comments

Comments
 (0)