fixes tests

This commit is contained in:
Gustavo Fuhr 2022-11-30 04:31:34 -03:00
parent 31411997bc
commit 8320a95e16
2 changed files with 5 additions and 5 deletions

View File

@ -71,7 +71,7 @@ const App = (): ReactElement => {
<Route path="/" element={<Redirect to="/c/login" />} /> <Route path="/" element={<Redirect to="/c/login" />} />
<Route path="/c/login" element={<LoginPage />} /> <Route path="/c/login" element={<LoginPage />} />
<Route path="/c/registration" element={<RegistationPage />} /> <Route path="/c/registration" element={<RegistationPage />} />
<Route path="/c/registration-google" component={RegistrationCallbackPage} /> <Route path="/c/registration-google" element={<RegistrationCallbackPage />} />
<Route path="/c/registration-success" element={<RegistrationSuccessPage />} /> <Route path="/c/registration-success" element={<RegistrationSuccessPage />} />
<Route path="/c/forgot-password" element={<ForgotPasswordPage />} /> <Route path="/c/forgot-password" element={<ForgotPasswordPage />} />
<Route <Route

View File

@ -10,7 +10,7 @@ import ReactGA from 'react-ga4';
import Client from '../../classes/client'; import Client from '../../classes/client';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { activeInstance } from '../../redux/clientSlice'; import { activeInstance } from '../../redux/clientSlice';
import { useHistory } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { css } from '@emotion/react'; import { css } from '@emotion/react';
import { CircularProgress } from '@mui/material'; import { CircularProgress } from '@mui/material';
@ -21,7 +21,7 @@ const RegistrationCallbackPage = (): React.ReactElement => {
const [email, setEmail] = useState(undefined); const [email, setEmail] = useState(undefined);
const [syncCode, setSyncCode] = useState(undefined); const [syncCode, setSyncCode] = useState(undefined);
const [googleSync, setGoogleSync] = useState(undefined); const [googleSync, setGoogleSync] = useState(undefined);
const history = useHistory(); const navigate = useNavigate();
useEffect(() => { useEffect(() => {
document.title = intl.formatMessage({ document.title = intl.formatMessage({
@ -42,7 +42,7 @@ const RegistrationCallbackPage = (): React.ReactElement => {
.then((result) => { .then((result) => {
if (result.googleSync) { if (result.googleSync) {
// if service reports that user already has sync accounts, go to maps page // if service reports that user already has sync accounts, go to maps page
history.push('/c/maps'); navigate('/c/maps');
} }
setEmail(result.email); setEmail(result.email);
setSyncCode(result.syncCode); setSyncCode(result.syncCode);
@ -62,7 +62,7 @@ const RegistrationCallbackPage = (): React.ReactElement => {
client client
.confirmAccountSync(email, syncCode) .confirmAccountSync(email, syncCode)
.then(() => { .then(() => {
history.push('/c/maps'); navigate('/c/maps');
}) })
.catch((error) => { .catch((error) => {
console.log('ERROR', error); console.log('ERROR', error);