Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix tagName in setValue() and setChecked() #771

Merged
merged 2 commits into from
Jun 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/test-utils/src/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand Down
1 change: 1 addition & 0 deletions test/specs/wrapper/setChecked.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
1 change: 1 addition & 0 deletions test/specs/wrapper/setSelected.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down