To test the useEffect hook with enzyme, you'll need to use a combination of the new react-dom/test-utils method act with enzyme mount. Shallow rendering does not trigger componentDidMount so that won't work.
act