user-event
user-event copied to clipboard
selectOptions could use the aria-label to find the value too
Problem description
Hi,
I am using the library to test a component built with headlessUI's combobox and I am using the selectOptions
method to select an option from the displayed listbox.
I have noticed that it's required that the value you provide matches exactly with the HTML value according to these lines of code . Would you accept a PR in which a check to the aria-label of the option is added?
Suggested solution
I was thinking about adding an additional check along the lines like:
var element = select.querySelector(
[aria-label=${option}]);
Additional context
No response