How can I write a test for selecting an item from a Select component that uses Portal?
I am writing a test for a Select
component using the shadcn/ui
package. This component has some parts (such as selectable items) that are rendered inside a Portal
. Because of this, I’m having trouble accessing and selecting items from the Portal
in my test. My expectation is that the test should click on the component, select an item with the text “Item 3”, and update the associated state correctly.
How can I write a test for selecting an item from a Select component that uses Portal?
I am writing a test for a Select
component using the shadcn/ui
package. This component has some parts (such as selectable items) that are rendered inside a Portal
. Because of this, I’m having trouble accessing and selecting items from the Portal
in my test. My expectation is that the test should click on the component, select an item with the text “Item 3”, and update the associated state correctly.