Fakultas Ilmu Komputer UI

Commit ac8ba65e authored by jahnsmichael's avatar jahnsmichael
Browse files

[RED] add new fetch hooks for forget password

parent e199ff61
......@@ -32,6 +32,25 @@ describe('Test API that needs token', () => {
expect(result.data).toMatchObject({token});
})
test('Forget Password', async () => {
const body = {
"email": "admin@admin.com"
}
mockedAxios.request.mockImplementationOnce(
() => new Promise(resolve => {
resolve({
status: 200,
data: "Password successfully changed"
});
})
);
const result = await withAuth.forgetPassword(body)
expect(result.status).toBe(200);
expect(result.data).toEqual("Password successfully changed");
})
test('Get current user profile', async () => {
const userProfile = {
"id": "d207657e-f0e6-4f9b-828e-af94fc654ca3",
......
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