diff --git a/src/SplitButton.js b/src/SplitButton.js index 6f68052c41..adf29fe792 100644 --- a/src/SplitButton.js +++ b/src/SplitButton.js @@ -14,6 +14,7 @@ class SplitButton extends React.Component { onClick, target, href, + toggleLabel, bsSize, bsStyle, ...props } = this.props; @@ -37,7 +38,7 @@ class SplitButton extends React.Component { {title} { assert.equal(linkElement.target, '_blank'); }); + it('should set aria-label on toggle from title', () => { + const instance = ReactTestUtils.renderIntoDocument(simple); + + const toggleNode = ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'dropdown-toggle'); + expect(toggleNode.getAttribute('aria-label')).to.equal('Title'); + }); + + it('should set aria-label on toggle from toggleLabel', () => { + const instance = ReactTestUtils.renderIntoDocument( + + Item 1 + + ); + + const toggleNode = ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'dropdown-toggle'); + expect(toggleNode.getAttribute('aria-label')).to.equal('Label'); + }); });