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
Tabs not compatible with react test renderer #14462
Comments
Quick fix would be to add a test on the breaking issue: |
Hi, since you can ref our test case in each components |
Thanks for help, it's working indeed with enzyme. |
Since some logic need to check dom properties like the component using popup (like select, tooltip, treeSelect, etc.) or auto size (like textarea, text, etc.). We have to access the real dom to get the data. For test case, we also need the jsdom env for dom api test usage, so we use enzyme for this. |
Maybe I should have added that I am generating snapshot tests. |
@florian-bd, I can't tell that a component lib should provide a mock version since sometime new version may have some bug. If user mock the component (like use jest But yes, if you want to just mock all of them. You can just use jest mock for whatever level mocks you want. |
All good points @zombieJ.
I don't mind writing the mocks for the components I use for sure, but I feel like this work should be shared. But I am gonna explore a bit more shallow rendering. I am a little bit stuck because I get a memory leak issue when I am using Enzyme + Storyshots but it's not your problem. |
We provide split components also. You can use like: |
Reproduction link
ant-design/components/tabs/index.tsx
Line 83 in 7ada839
Steps to reproduce
Try to use Tabs with react-test-renderer
What is expected?
Should work fine
What is actually happening?
TypeError: Cannot read property 'indexOf' of undefined
ReactDOM.findDOMNode is used and does not work as expected in the test renderer
The text was updated successfully, but these errors were encountered: