diff --git a/packages/widgets/tests/src/tabbar.spec.ts b/packages/widgets/tests/src/tabbar.spec.ts index 082eb979c..3ec977012 100644 --- a/packages/widgets/tests/src/tabbar.spec.ts +++ b/packages/widgets/tests/src/tabbar.spec.ts @@ -144,6 +144,7 @@ describe('@lumino/widgets', () => { tabsMovable: true, allowDeselect: true, addButtonEnabled: true, + scrollingEnabled: true, insertBehavior: 'select-tab', removeBehavior: 'select-previous-tab', renderer @@ -152,6 +153,7 @@ describe('@lumino/widgets', () => { expect(newBar.tabsMovable).to.equal(true); expect(newBar.renderer).to.equal(renderer); expect(newBar.addButtonEnabled).to.equal(true); + expect(newBar.scrollingEnabled).to.equal(true); }); it('should add the `lm-TabBar` class', () => { @@ -652,6 +654,37 @@ describe('@lumino/widgets', () => { }); }); + describe('#scrollingEnabled', () => { + it('should get whether the scroll buttons are enabled', () => { + let bar = new TabBar(); + expect(bar.scrollingEnabled).to.equal(false); + }); + + it('should set whether the scroll buttons are enabled', () => { + let bar = new TabBar(); + bar.scrollingEnabled = true; + expect(bar.scrollingEnabled).to.equal(true); + }); + + it('should not show the scroll buttons if not set', () => { + populateBar(bar); + expect( + bar.scrollBeforeButtonNode.classList.contains('lm-mod-hidden') + ).to.equal(true); + expect( + bar.scrollAfterButtonNode.classList.contains('lm-mod-hidden') + ).to.equal(true); + + bar.scrollingEnabled = true; + expect( + bar.scrollBeforeButtonNode.classList.contains('lm-mod-hidden') + ).to.equal(false); + expect( + bar.scrollAfterButtonNode.classList.contains('lm-mod-hidden') + ).to.equal(true); + }); + }); + describe('#allowDeselect', () => { it('should determine whether a tab can be deselected by the user', () => { populateBar(bar);