-
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.
feat: remove unnecessary console.log statements in auth-google module
- Loading branch information
Rayen Mabrouk
committed
May 11, 2024
1 parent
20f3e14
commit 2707116
Showing
3 changed files
with
0 additions
and
56 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
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 |
---|---|---|
|
@@ -37,55 +37,4 @@ describe('AuthGoogleService', () => { | |
console.log(google, configService); | ||
expect(service).toBeDefined(); | ||
}); | ||
|
||
// it('should get profile by token', async () => { | ||
// const dto: AuthGoogleLoginDto = { | ||
// idToken: 'testToken.test.test', | ||
// }; | ||
// const data = { | ||
// sub: '123', | ||
// email: '[email protected]', | ||
// given_name: 'John', | ||
// family_name: 'Doe', | ||
// picture: 'testPicture', | ||
// }; | ||
// const generatedIDToken = jest.fn( | ||
// () => `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c`, | ||
// ) | ||
// // jest.spyOn(service.google, 'verifyIdToken').mockResolvedValue({ | ||
// // getPayload: () => data, | ||
// // } as never); | ||
|
||
// // const result = await service.getProfileByToken({idToken: generatedIDToken()}); | ||
// expect(service.getProfileByToken).toHaveBeenCalled(); | ||
|
||
// expect(result).toEqual({ | ||
// id: '123', | ||
// email: '[email protected]', | ||
// firstName: 'John', | ||
// lastName: 'Doe', | ||
// picture: 'testPicture', | ||
// }); | ||
// }); | ||
|
||
// it('should throw an exception if token is wrong', async () => { | ||
// const dto: AuthGoogleLoginDto = { | ||
// idToken: 'testToken,.azrazr.azrazr', | ||
// }; | ||
// // jest.spyOn(service.google, 'verifyIdToken').mockResolvedValue({ | ||
// // getPayload: () => null, | ||
// // } as never); | ||
|
||
// await expect(service.getProfileByToken(dto)).rejects.toThrow( | ||
// new HttpException( | ||
// { | ||
// status: HttpStatus.UNPROCESSABLE_ENTITY, | ||
// errors: { | ||
// user: 'wrongToken', | ||
// }, | ||
// }, | ||
// HttpStatus.UNPROCESSABLE_ENTITY, | ||
// ), | ||
// ); | ||
// }); | ||
}); |
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