Skip to content

Commit fb640f6

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

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/jasmine/tests/range_slider_test.js

+27
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,33 @@ 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() {
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+
});
328+
329+
it('should plot when only y data is provided', function() {
330+
Plotly.plot(gd, [{ y: [1,2,3] }], { xaxis: { rangeslider: {} }})
331+
.then(function() {
332+
var rangeslider = document.getElementsByClassName('range-slider');
333+
334+
expect(rangeslider.length).toBe(1);
335+
});
336+
});
337+
});
311338
});
312339

313340

0 commit comments

Comments
 (0)