integration test fixes

This commit is contained in:
2025-12-23 16:32:05 -08:00
parent 921c48fc57
commit ae7afaaf97
11 changed files with 52 additions and 46 deletions

View File

@@ -624,14 +624,10 @@ describe('User DB Service', () => {
);
});
it('should throw NotFoundError if token is not found', async () => {
it('should return undefined if token is not found', async () => {
mockPoolInstance.query.mockResolvedValue({ rows: [], rowCount: 0 });
await expect(userRepo.findUserByRefreshToken('a-token', mockLogger)).rejects.toThrow(
NotFoundError,
);
await expect(userRepo.findUserByRefreshToken('a-token', mockLogger)).rejects.toThrow(
'User not found for the given refresh token.',
);
const result = await userRepo.findUserByRefreshToken('a-token', mockLogger);
expect(result).toBeUndefined();
});
it('should throw a generic error if the database query fails', async () => {