Skip to content

Commit f092c44

Browse files
Add interaction test for new attributes
1 parent 9c66f81 commit f092c44

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

test/jasmine/tests/range_slider_test.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ describe('the range slider', function() {
559559
});
560560
});
561561

562-
fdescribe('yaxis options', function() {
562+
describe('yaxis options', function() {
563563

564564
it('should be set one yaxis is present', function() {
565565
var mock = {
@@ -792,6 +792,28 @@ describe('the range slider', function() {
792792
})
793793
.then(done);
794794
});
795+
796+
it('should configure yaxis opts on relayout', function(done) {
797+
Plotly.plot(gd, [{
798+
y: [2, 1, 2]
799+
}], {
800+
xaxis: { rangeslider: { yaxis: { range: [-10, 20] } } }
801+
})
802+
.then(function() {
803+
expect(gd.layout.xaxis.rangeslider.yaxis).toEqual({ rangemode: 'fixed', range: [-10, 20] });
804+
805+
return Plotly.relayout(gd, 'xaxis.rangeslider.yaxis.rangemode', 'auto');
806+
})
807+
.then(function() {
808+
expect(gd.layout.xaxis.rangeslider.yaxis).toEqual({ rangemode: 'auto', range: [0.9201631701631702, 2.0798368298368297] });
809+
810+
return Plotly.relayout(gd, 'xaxis.rangeslider.yaxis.rangemode', 'match');
811+
})
812+
.then(function() {
813+
expect(gd.layout.xaxis.rangeslider.yaxis).toEqual({ rangemode: 'match' });
814+
})
815+
.then(done);
816+
});
795817
});
796818
});
797819

0 commit comments

Comments
 (0)