fix(auth): update error messages in AuthService tests for clarity

This commit is contained in:
Timothy Atapagra 2025-10-18 00:57:35 -04:00
parent 82b4de5695
commit b0e508fe4e

View file

@ -459,7 +459,7 @@ describe('AuthService', () => {
mockUserService.findById.mockResolvedValue(null)
await expect(service.confirmEmail('verification-token')).rejects.toThrow(
'USER_NOT_FOUND',
'User not found',
)
expect(emailVerificationService.verifyToken).toHaveBeenCalledWith(
@ -535,7 +535,7 @@ describe('AuthService', () => {
await expect(
service.resendVerification('test@example.com'),
).rejects.toThrow('USER_NOT_FOUND')
).rejects.toThrow('User not found')
expect(userService.findByEmail).toHaveBeenCalledWith('test@example.com')
})
@ -547,7 +547,7 @@ describe('AuthService', () => {
await expect(
service.resendVerification('test@example.com'),
).rejects.toThrow('USER_ALREADY_VERIFIED')
).rejects.toThrow('Email already verified. Please login to continue.')
expect(userService.findByEmail).toHaveBeenCalledWith('test@example.com')
})