Skip to content

Commit ca7c175

Browse files
committed
Add test for rangesliders when incomplete data provided
1 parent 20ec5c0 commit ca7c175

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/jasmine/tests/range_slider_test.js

+29
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,35 @@ describe('the range slider', function() {
308308
expect(layoutOut).toEqual(expected);
309309
});
310310
});
311+
312+
describe('in general', function() {
313+
314+
beforeEach(function() {
315+
gd = createGraphDiv();
316+
});
317+
318+
afterEach(destroyGraphDiv);
319+
320+
it('should plot when only x data is provided', function(done) {
321+
Plotly.plot(gd, [{ x: [1,2,3] }], { xaxis: { rangeslider: {} }})
322+
.then(function() {
323+
var rangeslider = document.getElementsByClassName('range-slider');
324+
325+
expect(rangeslider.length).toBe(1);
326+
})
327+
.then(done);
328+
});
329+
330+
it('should plot when only y data is provided', function(done) {
331+
Plotly.plot(gd, [{ y: [1,2,3] }], { xaxis: { rangeslider: {} }})
332+
.then(function() {
333+
var rangeslider = document.getElementsByClassName('range-slider');
334+
335+
expect(rangeslider.length).toBe(1);
336+
})
337+
.then(done);
338+
});
339+
});
311340
});
312341

313342

0 commit comments

Comments
 (0)