Skip to content

Commit

Permalink
modified all 4 testings
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaineng committed Apr 25, 2024
1 parent 517f35e commit 2e92790
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions api/authFunctions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,12 @@ describe('Auth Functions', () => {

//user failed to log in
it('should send error if user could not log in', async () => {
const userDummy = {
const failDummy = {
email: "[email protected]",
password: "tet1234"
password: "tet1234679"
};
const error: Error = new Error('User not found');

(loginAccount as jest.Mock).mockRejectedValue(error);

try {
await loginAccount(userDummy);
} catch (error) {
expect((error as Error).message).toEqual('User not found');
}
await loginAccount(failDummy)
expect(loginAccount(failDummy)).rejects.toThrow('error')
});
})

Expand Down

0 comments on commit 2e92790

Please sign in to comment.