Hi! Thanks for the great libraries! I'm running into some issues trying to write enzyme unit tests for a component that follows a pattern like this, where Fetch comes from react-request:
<Composer components=[FetchComponentA, FetchComponentB] />
{([fetchA, fetchB]) => {
if (fetchA.failed || fetchB.failed) {
return <ErrorPage ... />;
}
if (fetchA.fetching || fetchB.fetching) {
return <LoadingPage ... />;
}
return <HappyPage ... />;
}}
</Composer>
Do you have any examples you can share of how to test this pattern? I seem to be having trouble getting at the underlying promise chain, so my tests complete before fetchA, fetchB, fetchC all resolve.
Thanks!
Hi! Thanks for the great libraries! I'm running into some issues trying to write enzyme unit tests for a component that follows a pattern like this, where
Fetchcomes fromreact-request:Do you have any examples you can share of how to test this pattern? I seem to be having trouble getting at the underlying promise chain, so my tests complete before
fetchA, fetchB, fetchCall resolve.Thanks!