user-event icon indicating copy to clipboard operation
user-event copied to clipboard

selectOptions could use the aria-label to find the value too

Open EduardoSimon opened this issue 1 year ago • 0 comments

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

EduardoSimon avatar Jun 09 '23 10:06 EduardoSimon