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
selectOptions by option content #203
Comments
I think it would be more in line with the other methods to just do something like this:
|
Are there any use cases for using an option selector other than |
I've seen people use |
Hello, I come from Ruby and Rails land, where the syntax for selecting an option using Capybara looks like this:
The option is selected based on the visible text of the Docs for this method are here: https://www.rubydoc.info/github/jnicklas/capybara/Capybara%2FNode%2FActions:select I was, therefore, expecting I would agree with @jsphstls that the default behaviour should be selecting by the Additionally, if you do something like:
You don't get a warning that the option value doesn't exist in the |
I think this PR handles this best, so I'll go ahead and close this. |
https://github.com/testing-library/user-event#selectoptionselement-values
Users do not interact with
<select/>
elements by the optionvalue
because it is not visible. Users typically select by the text content of each option that they can see.This is possibly a separate issue, but the current example in the readme is unclear about whether the option content or the value is used to select because the values and content are the same.
While the example is unclear, there is some text:
The values parameter can be either an array of values or a singular scalar value.
The text was updated successfully, but these errors were encountered: