Skip to content
Snippets Groups Projects
Verified Commit 5407fdb9 authored by Defendi Alberto's avatar Defendi Alberto
Browse files

Initialize ProfilePage

parent a012d96b
No related branches found
No related tags found
1 merge request!33Connect api calls and include test/docs cases
import React from 'react';
import { render } from '@testing-library/react';
import { ProfilePage } from './ProfilePage';
describe('<ProfilePage />', () => {
it('renders without crashing', () => {
const wrapper = render(<ProfilePage />);
expect(wrapper.queryByTestId('ProfilePage')).toBeTruthy();
});
});
import React, { FC } from 'react';
import Button from '@material-ui/core/Button';
import axios from 'axios';
import { NonAuthRoutes } from 'components/api/routes';
import { useHistory } from 'react-router-dom';
export const ProfilePage: FC = () => {
const history = useHistory();
const logout = (): void => {
axios
.post('/api/web/login/logout')
.then(() => history.replace(NonAuthRoutes.home));
};
return (
<div data-testid="ProfilePage">
<Button variant="outlined" color="default" onClick={logout}>
Logout
</Button>
</div>
);
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment