Open JESii opened 5 years ago
I believe the Select is using something like a Portal to render the elements because the options themselves are outside the root of the main app...
enzyme doesn't generate any code - components themselves do. This just seems like how ant design works - ie, it doesn't actually produce the class names you typed in the actual DOM.
Thanks for reporting an issue to us! We're glad you are using and invested in Enzyme. Before submitting, please read over our commonly reported issues to prevent duplicates!
All common issues
Notoriously common issues
If you haven't found any duplicated issues, please report it with your environment!
Issue
When creating a Select element with ant design (antd Select), I am unable to find a class that is generated by the Select for the dropdown element.
App Code
Test Code
Current behavior
find('.bw-select-selection-selected-value')
fails to find the desired divThe test fails with:
Expected behavior
It should find that element, as this Chrome DevTools screenshot shows that the class has been properly rendered.
Failure analysis
The code that Enzyme generates for the mount() has the class name
bw-select-selection-selected-value
replaced withant-select-selection-selected-value
as can be seen from the wrapper.debug() output below.Your environment
API
Version
Adapter
wrapper.debug() output