diff --git a/packages/react-dom/src/__tests__/ReactDOMInput-test.js b/packages/react-dom/src/__tests__/ReactDOMInput-test.js index 1f65ae3fb7a56..6bfe0301cceb7 100644 --- a/packages/react-dom/src/__tests__/ReactDOMInput-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMInput-test.js @@ -796,7 +796,7 @@ describe('ReactDOMInput', () => { ReactTestUtils.renderIntoDocument(); expectDev(console.error.calls.argsFor(0)[0]).toContain( '`value` prop on `input` should not be null. ' + - 'Consider using the empty string to clear the component or `undefined` ' + + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', ); diff --git a/packages/react-dom/src/__tests__/ReactDOMSelect-test.js b/packages/react-dom/src/__tests__/ReactDOMSelect-test.js index ae558db9e4c43..356bc4787502e 100644 --- a/packages/react-dom/src/__tests__/ReactDOMSelect-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMSelect-test.js @@ -514,7 +514,7 @@ describe('ReactDOMSelect', () => { ); expectDev(console.error.calls.argsFor(0)[0]).toContain( '`value` prop on `select` should not be null. ' + - 'Consider using the empty string to clear the component or `undefined` ' + + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', ); @@ -524,6 +524,25 @@ describe('ReactDOMSelect', () => { expectDev(console.error.calls.count()).toBe(1); }); + it('should warn if value is null and multiple is true', () => { + spyOn(console, 'error'); + ReactTestUtils.renderIntoDocument( + , + ); + + expectDev(console.error.calls.argsFor(0)[0]).toContain( + '`value` prop on `select` should not be null. ' + + 'Consider using an empty array when `multiple` is ' + + 'set to `true` to clear the component or `undefined` ' + + 'for uncontrolled components.', + ); + + ReactTestUtils.renderIntoDocument( + , + ); + expectDev(console.error.calls.count()).toBe(1); + }); + it('should refresh state on change', () => { var stub = (