Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL Sosial
tbcare
tbcare-mobile
Commits
330a75d8
Commit
330a75d8
authored
Jun 06, 2021
by
jahnsmichael
Browse files
[RED] new fetch services for edit profile
parent
27ea76a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/services/hooks/useMainService/index.test.tsx
View file @
330a75d8
...
...
@@ -78,6 +78,32 @@ describe('Test API that needs token', () => {
expect
(
result
.
data
).
toMatchObject
(
userProfile
);
})
test
(
'
Edit current user profile
'
,
async
()
=>
{
const
newUserProfile
=
{
"
new_username
"
:
"
admin
"
,
"
new_name
"
:
"
admin
"
,
"
new_email
"
:
"
admin@email.com
"
,
"
new_password
"
:
"
akupasskamu123
"
,
"
confirm_new_password
"
:
"
akupasskamu123
"
,
"
new_phone_number
"
:
"
0812682163256
"
,
"
new_district
"
:
"
Tapos
"
,
"
new_sub_district
"
:
"
Sukatani
"
,
}
mockedAxios
.
request
.
mockImplementationOnce
(
()
=>
new
Promise
(
resolve
=>
{
resolve
({
status
:
200
,
data
:
"
Profile successfully updated
"
,
});
})
);
const
result
=
await
withAuth
.
editProfile
(
newUserProfile
)
expect
(
result
.
status
).
toBe
(
200
);
expect
(
result
.
data
).
toEqual
(
"
Profile successfully updated
"
);
})
test
(
'
Create user
'
,
async
()
=>
{
const
userProfile
=
{
"
username
"
:
"
admin
"
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment