@@ -132,6 +132,7 @@ describe('@lumino/widgets', () => {
132
132
tabsMovable : true ,
133
133
allowDeselect : true ,
134
134
addButtonEnabled : true ,
135
+ scrollingEnabled : true ,
135
136
insertBehavior : 'select-tab' ,
136
137
removeBehavior : 'select-previous-tab' ,
137
138
renderer
@@ -140,6 +141,7 @@ describe('@lumino/widgets', () => {
140
141
expect ( newBar . tabsMovable ) . to . equal ( true ) ;
141
142
expect ( newBar . renderer ) . to . equal ( renderer ) ;
142
143
expect ( newBar . addButtonEnabled ) . to . equal ( true ) ;
144
+ expect ( newBar . scrollingEnabled ) . to . equal ( true ) ;
143
145
} ) ;
144
146
145
147
it ( 'should add the `lm-TabBar` class' , ( ) => {
@@ -588,6 +590,37 @@ describe('@lumino/widgets', () => {
588
590
} ) ;
589
591
} ) ;
590
592
593
+ describe ( '#scrollingEnabled' , ( ) => {
594
+ it ( 'should get whether the scroll buttons are enabled' , ( ) => {
595
+ let bar = new TabBar < Widget > ( ) ;
596
+ expect ( bar . scrollingEnabled ) . to . equal ( false ) ;
597
+ } ) ;
598
+
599
+ it ( 'should set whether the scroll buttons are enabled' , ( ) => {
600
+ let bar = new TabBar < Widget > ( ) ;
601
+ bar . scrollingEnabled = true ;
602
+ expect ( bar . scrollingEnabled ) . to . equal ( true ) ;
603
+ } ) ;
604
+
605
+ it ( 'should not show the scroll buttons if not set' , ( ) => {
606
+ populateBar ( bar ) ;
607
+ expect (
608
+ bar . scrollBeforeButtonNode . classList . contains ( 'lm-mod-hidden' )
609
+ ) . to . equal ( true ) ;
610
+ expect (
611
+ bar . scrollAfterButtonNode . classList . contains ( 'lm-mod-hidden' )
612
+ ) . to . equal ( true ) ;
613
+
614
+ bar . scrollingEnabled = true ;
615
+ expect (
616
+ bar . scrollBeforeButtonNode . classList . contains ( 'lm-mod-hidden' )
617
+ ) . to . equal ( false ) ;
618
+ expect (
619
+ bar . scrollAfterButtonNode . classList . contains ( 'lm-mod-hidden' )
620
+ ) . to . equal ( true ) ;
621
+ } ) ;
622
+ } ) ;
623
+
591
624
describe ( '#allowDeselect' , ( ) => {
592
625
it ( 'should determine whether a tab can be deselected by the user' , ( ) => {
593
626
populateBar ( bar ) ;
0 commit comments