-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from isdi-coders-2023/feature/usersFiles
Fix the problems with register and login methods
- Loading branch information
Showing
6 changed files
with
40 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,10 +27,6 @@ describe('UserController', () => { | |
} as unknown as Response; | ||
const mockNext = jest.fn(); | ||
|
||
const mockUser = { | ||
email: '[email protected]', | ||
password: await Auth.hash('password123'), | ||
}; | ||
Auth.compare = jest.fn().mockResolvedValueOnce(true); | ||
Auth.signJwt = jest.fn().mockReturnValueOnce('mockToken'); | ||
|
||
|
@@ -70,11 +66,7 @@ describe('UserController', () => { | |
await controller.login(mockRequest, mockResponse, mockNext); | ||
|
||
expect(mockNext).toHaveBeenCalledWith( | ||
new HttpError( | ||
400, | ||
'Bad Request', | ||
'Email/name and password are required' | ||
) | ||
new HttpError(400, 'Bad Request', 'Email and password are required') | ||
); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters