Fakultas Ilmu Komputer UI

Commit 330a75d8 authored by jahnsmichael's avatar jahnsmichael
Browse files

[RED] new fetch services for edit profile

parent 27ea76a8
......@@ -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",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment