This commit is contained in:
magdo
2025-11-25 00:07:54 +01:00
parent 05a1ad4017
commit bf9503c7be
7 changed files with 295 additions and 52 deletions
@@ -65,6 +65,7 @@ describe('EmailService', () => {
subject: emailOptions.subject,
html: emailOptions.html,
text: emailOptions.text,
attachments: expect.any(Array),
});
});
@@ -88,8 +89,9 @@ describe('EmailService', () => {
from: process.env.EMAIL_FROM || 'noreply@serpentrace.com',
to: emailOptions.to,
subject: emailOptions.subject,
html: expect.stringContaining('John'),
text: expect.stringContaining('John'),
html: expect.any(String),
text: expect.any(String),
attachments: expect.any(Array),
});
});
@@ -321,7 +321,7 @@ describe('TokenService', () => {
const url = TokenService.generateVerificationUrl(baseUrl, token);
// Assert
expect(url).toBe('https://example.com/api/auth/verify-email?token=verification-token-123');
expect(url).toBe('https://example.com/verify-email?token=verification-token-123');
});
it('should handle base URL with trailing slash', () => {
@@ -333,7 +333,7 @@ describe('TokenService', () => {
const url = TokenService.generateVerificationUrl(baseUrl, token);
// Assert
expect(url).toBe('https://example.com/api/auth/verify-email?token=verification-token-123');
expect(url).toBe('https://example.com/verify-email?token=verification-token-123');
});
it('should encode special characters in token', () => {
@@ -359,7 +359,7 @@ describe('TokenService', () => {
const url = TokenService.generatePasswordResetUrl(baseUrl, token);
// Assert
expect(url).toBe('https://example.com/api/auth/reset-password?token=reset-token-456');
expect(url).toBe('https://example.com/reset-password?token=reset-token-456');
});
});