Need help for my unit test with load
See original GitHub issue💬 Questions and Help
I have a wrapped loadableComponent inside another stateless component, I want to check if the loadable it’s already rendered, previously with react-loadable
, we didn’t need to worry about this since with the help of preloadAll()
we achieved it, but not sure how to force the load of the component before my assertion happen.
const wrapper = mount(<Wrapper name="test" `/>);
expect(wrapper.find('svg')).toHaveLength(1); // not loaded yet
const Wrapper = (props) => {
const MyLoadable = loadable(() => import('./MyOtherComp');
return (<Errors><MyLoadable /></Errors>);
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Create and run a load test - Visual Studio (Windows)
Learn how to create a load test that contains unit tests. You create and run load tests using Visual Studio Enterprise.
Read more >Adding unit tests to visual studio 2017 load test - Stack Overflow
You need to have the tests target the correct framework dll manually. VS Load Test will not detect unit tests in newer versions....
Read more >What is a good method to unit test the load of the Config File in ...
I want to setup a test sequence, invoke the InitAllSettings.xaml and then put some activities in to unit test the load of the...
Read more >To load or not to load data for unit tests from external files
So long answer short, it depends on what you're testing and why. Both approaches are useful and have their place - choose what...
Read more >Keys to Successful Unit Testing - Software Testing Help
The process becomes agile: To add new functions or features to the existing software, we need to make changes to the old code....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With react-testing-library you should be able to wait for the component to be ready.
Hey @yanv1991 👋, Thank you for opening an issue. We’ll get back to you as soon as we can. Please, consider supporting us on Open Collective. We give a special attention to issues opened by backers. If you use Loadable at work, you can also ask your company to sponsor us ❤️.
<link>