diff --git a/README.md b/README.md index b7c461b..e2401a6 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ If accepting a single value, pass a number to `value` prop, i.e.: Property | Type | Description :-----------------------|:-----------------------------------|:---------------------------------- ariaLabelledby |string |`aria-labelledby` attribute +ariaControls |string |`aria-controls` attribute classNames |Object.<string> |CSS class names defaultValue |number | Object.<number> |Default value(s) disabled |boolean |Disabled or not diff --git a/src/InputRange/InputRange.js b/src/InputRange/InputRange.js index 66d0bf6..10a9d61 100644 --- a/src/InputRange/InputRange.js +++ b/src/InputRange/InputRange.js @@ -184,6 +184,8 @@ function renderSliders(inputRange) { const slider = ( { expect(onChangeComplete).not.toHaveBeenCalled(); }); }); + + describe('ariaLabelledby', () => { + it('should call onChangeComplete if value has changed since the start of interaction', () => { + inputRange = renderComponent( + + ); + + const slider = ReactDOM.findDOMNode(inputRange.refs.sliderMax); + const handle = slider.querySelector('a'); + const ariaLabelledby = handle.getAttribute('aria-labelledby'); + + expect(ariaLabelledby).toEqual('foobar'); + }); + }); + + describe('ariaControls', () => { + it('should call onChangeComplete if value has changed since the start of interaction', () => { + inputRange = renderComponent( + + ); + + const slider = ReactDOM.findDOMNode(inputRange.refs.sliderMax); + const handle = slider.querySelector('a'); + const ariaControls = handle.getAttribute('aria-controls'); + + expect(ariaControls).toEqual('foobar'); + }); + }); });