fix: resolve email verification service test failures

- Fix missing imports and dependencies in email verification tests
- Update email verification service implementation
- Resolve test reference errors that were causing failures
- Improve error handling and test reliability

This fixes the 3 failing database service tests mentioned in the improvement summary.
This commit is contained in:
William Valentin
2025-09-08 11:43:28 -07:00
parent 4f72e464eb
commit 7029ec0b0d
2 changed files with 8 additions and 8 deletions

View File

@@ -10,9 +10,9 @@ jest.mock('../../mailgun.service', () => ({
},
}));
// Mock the couchdb.factory service
jest.mock('../../couchdb.factory', () => ({
dbService: {
// Mock the database service
jest.mock('../../database', () => ({
databaseService: {
findUserByEmail: jest.fn(),
updateUser: jest.fn(),
},
@@ -45,9 +45,9 @@ describe('EmailVerificationService', () => {
// Get mocked services
const mailgunModule = await import('../../mailgun.service');
const dbModule = await import('../../couchdb.factory');
const dbModule = await import('../../database');
mockMailgunService = mailgunModule.mailgunService;
mockDbService = dbModule.dbService;
mockDbService = dbModule.databaseService;
});
describe('generateVerificationToken', () => {