diff --git a/test/Select-test.js b/test/Select-test.js index fe3c6d2706..3b43d12238 100644 --- a/test/Select-test.js +++ b/test/Select-test.js @@ -3061,6 +3061,40 @@ describe('Select', () => { }); }); + describe('inputRenderer', () => { + + var inputRenderer; + + beforeEach(() => { + + inputRenderer = (inputProps) => { + return ( + + ); + }; + + inputRenderer = sinon.spy(inputRenderer); + + instance = createControl({ + options: defaultOptions, + inputRenderer: inputRenderer + }); + }); + + it('renders the options using the inputRenderer', () => { + var input = ReactDOM.findDOMNode(instance).querySelector('#custom-input'); + expect(input, 'not to equal', undefined); + }); + + it('calls the renderer exactly once', () => { + expect(inputRenderer, 'was called times', 1); + }); + + it('calls the renderer with props', () => { + expect(inputRenderer, 'was called with', { value: '', className: 'Select-input' }); + }); + }); + describe('optionRenderer', () => { var optionRenderer;