@@ -65,7 +65,7 @@ describe('Visible rangesliders', function() {
6565 . then ( done ) ;
6666 } ) ;
6767
68- it ( 'should have the correct width and height ' , function ( done ) {
68+ it ( 'should have the correct style and size and be able to update these ' , function ( done ) {
6969 plotMock ( ) . then ( function ( ) {
7070 var bg = getRangeSliderChild ( 0 ) ;
7171
@@ -75,18 +75,26 @@ describe('Visible rangesliders', function() {
7575 // width incorporates border widths
7676 expect ( + bg . getAttribute ( 'width' ) ) . toEqual ( expectedWidth ) ;
7777 expect ( + bg . getAttribute ( 'height' ) ) . toEqual ( 66 ) ;
78- } )
79- . catch ( failTest )
80- . then ( done ) ;
81- } ) ;
82-
83- it ( 'should have the correct style' , function ( done ) {
84- plotMock ( ) . then ( function ( ) {
85- var bg = getRangeSliderChild ( 0 ) ;
8678
8779 expect ( bg . getAttribute ( 'fill' ) ) . toBe ( '#fafafa' ) ;
8880 expect ( bg . getAttribute ( 'stroke' ) ) . toBe ( 'black' ) ;
89- expect ( bg . getAttribute ( 'stroke-width' ) ) . toBe ( '2' ) ;
81+ expect ( + bg . getAttribute ( 'stroke-width' ) ) . toBe ( 2 ) ;
82+
83+ return Plotly . relayout ( gd , {
84+ 'xaxis.rangeslider.thickness' : 0.1 ,
85+ 'xaxis.rangeslider.bgcolor' : '#ffff80' ,
86+ 'xaxis.rangeslider.bordercolor' : '#404040' ,
87+ 'xaxis.rangeslider.borderwidth' : 1
88+ } ) ;
89+ } )
90+ . then ( function ( ) {
91+ var bg = getRangeSliderChild ( 0 ) ;
92+
93+ expect ( + bg . getAttribute ( 'height' ) ) . toEqual ( 32 ) ;
94+
95+ expect ( bg . getAttribute ( 'fill' ) ) . toBe ( '#ffff80' ) ;
96+ expect ( bg . getAttribute ( 'stroke' ) ) . toBe ( '#404040' ) ;
97+ expect ( + bg . getAttribute ( 'stroke-width' ) ) . toBe ( 1 ) ;
9098 } )
9199 . catch ( failTest )
92100 . then ( done ) ;
0 commit comments