I'm testing my Login component which implements Microsoft authentication for login. I'm returning empty fragment from Login.js. How can I test this using React Testing library and jest?
import { useEffect } from 'react';
import { msalInstance } from './authConfig';
export const Login = () => {
useEffect(() => {
msalInstance
.handleRedirectPromise()
.then((tokenResponse) => {
if (!tokenResponse) {
const accounts = msalInstance.getAllAccounts();
if (accounts.length === 0) {
// No user signed in
msalInstance.loginRedirect();
}
}
})
.catch((err) => {
console.error(err);
});
}, []);
return <></>;
};