How to unit test @auth0/auth0-react

Hi I’m using @auth0/auth0-react library

I flowed the tutorial The Complete Guide to React User Authentication with Auth0

my problem is with unit testing of the Profile component

import React from “react”;
import { Container, Row, Col } from “react-bootstrap”;
import { Highlight, Loading } from “…/components”;

import { useAuth0, withAuthenticationRequired } from “@auth0/auth0-react”;

const Profile = () => {
const { user } = useAuth0();
const { name, picture, email } = user;

return (




{JSON.stringify(user, null, 2)}


export default withAuthenticationRequired(Profile, {
onRedirecting: () => ,

in this code example, I can never test the component because in the unit test I get the Loading component -

How can mock user is Authenticated = true with a mock auth0 provider so I can the component

Thank you