diff --git a/packages/test-utils/src/wrapper.js b/packages/test-utils/src/wrapper.js index 77ed8c2c7..53d822d69 100644 --- a/packages/test-utils/src/wrapper.js +++ b/packages/test-utils/src/wrapper.js @@ -748,7 +748,7 @@ export default class Wrapper implements BaseWrapper { this.trigger('change') } } - } else if (tagName === 'INPUT' || tagName === 'textarea') { + } else if (tagName === 'INPUT' || tagName === 'TEXTAREA') { throwError( `wrapper.setChecked() cannot be called on "text" ` + `inputs. Use wrapper.setValue() instead` @@ -795,7 +795,7 @@ export default class Wrapper implements BaseWrapper { `type="radio" /> element. Use wrapper.setChecked() ` + `instead` ) - } else if (tagName === 'INPUT' || tagName === 'textarea') { + } else if (tagName === 'INPUT' || tagName === 'TEXTAREA') { throwError( `wrapper.setSelected() cannot be called on "text" ` + `inputs. Use wrapper.setValue() instead` diff --git a/test/specs/wrapper/setChecked.spec.js b/test/specs/wrapper/setChecked.spec.js index 805b504b8..4c6accb09 100644 --- a/test/specs/wrapper/setChecked.spec.js +++ b/test/specs/wrapper/setChecked.spec.js @@ -93,6 +93,7 @@ describeWithShallowAndMount('setChecked', mountingMethod => { const message = 'wrapper.setChecked() cannot be called on "text" inputs. Use wrapper.setValue() instead' shouldThrowErrorOnElement('input[type="text"]', message) + shouldThrowErrorOnElement('textarea', message) }) it('throws error if element is not valid', () => { diff --git a/test/specs/wrapper/setSelected.spec.js b/test/specs/wrapper/setSelected.spec.js index c374af856..5b6375d5f 100644 --- a/test/specs/wrapper/setSelected.spec.js +++ b/test/specs/wrapper/setSelected.spec.js @@ -49,6 +49,7 @@ describeWithShallowAndMount('setSelected', mountingMethod => { const message = 'wrapper.setSelected() cannot be called on "text" inputs. Use wrapper.setValue() instead' shouldThrowErrorOnElement('input[type="text"]', message) + shouldThrowErrorOnElement('textarea', message) }) it('throws error if element is not valid', () => {