Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
red-giant
dashboard
Commits
5407fdb9
Verified
Commit
5407fdb9
authored
3 years ago
by
Defendi Alberto
Browse files
Options
Downloads
Patches
Plain Diff
Initialize ProfilePage
parent
a012d96b
No related branches found
No related tags found
1 merge request
!33
Connect api calls and include test/docs cases
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/ProfilePage/ProfilePage.test.tsx
+10
-0
10 additions, 0 deletions
src/components/ProfilePage/ProfilePage.test.tsx
src/components/ProfilePage/ProfilePage.tsx
+23
-0
23 additions, 0 deletions
src/components/ProfilePage/ProfilePage.tsx
with
33 additions
and
0 deletions
src/components/ProfilePage/ProfilePage.test.tsx
0 → 100644
+
10
−
0
View file @
5407fdb9
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
();
});
});
This diff is collapsed.
Click to expand it.
src/components/ProfilePage/ProfilePage.tsx
0 → 100644
+
23
−
0
View file @
5407fdb9
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
>
);
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment