@@ -144,6 +144,7 @@ describe('@lumino/widgets', () => {
144
144
tabsMovable : true ,
145
145
allowDeselect : true ,
146
146
addButtonEnabled : true ,
147
+ scrollingEnabled : true ,
147
148
insertBehavior : 'select-tab' ,
148
149
removeBehavior : 'select-previous-tab' ,
149
150
renderer
@@ -152,6 +153,7 @@ describe('@lumino/widgets', () => {
152
153
expect ( newBar . tabsMovable ) . to . equal ( true ) ;
153
154
expect ( newBar . renderer ) . to . equal ( renderer ) ;
154
155
expect ( newBar . addButtonEnabled ) . to . equal ( true ) ;
156
+ expect ( newBar . scrollingEnabled ) . to . equal ( true ) ;
155
157
} ) ;
156
158
157
159
it ( 'should add the `lm-TabBar` class' , ( ) => {
@@ -652,6 +654,37 @@ describe('@lumino/widgets', () => {
652
654
} ) ;
653
655
} ) ;
654
656
657
+ describe ( '#scrollingEnabled' , ( ) => {
658
+ it ( 'should get whether the scroll buttons are enabled' , ( ) => {
659
+ let bar = new TabBar < Widget > ( ) ;
660
+ expect ( bar . scrollingEnabled ) . to . equal ( false ) ;
661
+ } ) ;
662
+
663
+ it ( 'should set whether the scroll buttons are enabled' , ( ) => {
664
+ let bar = new TabBar < Widget > ( ) ;
665
+ bar . scrollingEnabled = true ;
666
+ expect ( bar . scrollingEnabled ) . to . equal ( true ) ;
667
+ } ) ;
668
+
669
+ it ( 'should not show the scroll buttons if not set' , ( ) => {
670
+ populateBar ( bar ) ;
671
+ expect (
672
+ bar . scrollBeforeButtonNode . classList . contains ( 'lm-mod-hidden' )
673
+ ) . to . equal ( true ) ;
674
+ expect (
675
+ bar . scrollAfterButtonNode . classList . contains ( 'lm-mod-hidden' )
676
+ ) . to . equal ( true ) ;
677
+
678
+ bar . scrollingEnabled = true ;
679
+ expect (
680
+ bar . scrollBeforeButtonNode . classList . contains ( 'lm-mod-hidden' )
681
+ ) . to . equal ( false ) ;
682
+ expect (
683
+ bar . scrollAfterButtonNode . classList . contains ( 'lm-mod-hidden' )
684
+ ) . to . equal ( true ) ;
685
+ } ) ;
686
+ } ) ;
687
+
655
688
describe ( '#allowDeselect' , ( ) => {
656
689
it ( 'should determine whether a tab can be deselected by the user' , ( ) => {
657
690
populateBar ( bar ) ;
0 commit comments