Skip to content

Commit 2aedde7

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

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

test/jasmine/tests/range_slider_test.js

+25-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ describe('the range slider', function() {
136136
});
137137
});
138138

139-
140139
describe('visibility property', function() {
141140
beforeEach(function() {
142141
gd = createGraphDiv();
@@ -308,6 +307,31 @@ describe('the range slider', function() {
308307
expect(layoutOut).toEqual(expected);
309308
});
310309
});
310+
311+
describe('in general', function() {
312+
313+
beforeEach(function() {
314+
gd = createGraphDiv();
315+
});
316+
317+
afterEach(destroyGraphDiv);
318+
319+
it('should plot when only x or y data are provided', function() {
320+
Plotly.plot(gd, [{ x: [1,2,3] }], { xaxis: { rangeslider: {} }})
321+
.then(function() {
322+
var rangeslider = document.getElementsByClassName('range-slider');
323+
324+
expect(rangeslider.length).toBe(1);
325+
});
326+
327+
Plotly.plot(gd, [{ y: [1,2,3] }], { xaxis: { rangeslider: {} }})
328+
.then(function() {
329+
var rangeslider = document.getElementsByClassName('range-slider');
330+
331+
expect(rangeslider.length).toBe(1);
332+
});
333+
});
334+
});
311335
});
312336

313337

0 commit comments

Comments
 (0)