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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user