save
This commit is contained in:
@@ -14,9 +14,11 @@ describe('DeckMapper', () => {
|
||||
],
|
||||
playedNumber: 5,
|
||||
ctype: CType.PUBLIC,
|
||||
updatedate: new Date('2024-01-02'),
|
||||
updateDate: new Date('2024-01-02'),
|
||||
state: State.ACTIVE,
|
||||
organization: null,
|
||||
user: { username: 'testuser', id: 'user-123', isAdmin: false },
|
||||
isEditable: jest.fn().mockReturnValue(true),
|
||||
...overrides
|
||||
});
|
||||
|
||||
|
||||
@@ -11,9 +11,10 @@ describe('OrganizationMapper', () => {
|
||||
contactemail: 'john@test.org',
|
||||
state: OrganizationState.ACTIVE as OrganizationStateType,
|
||||
regdate: new Date('2024-01-01'),
|
||||
updatedate: new Date('2024-01-02'),
|
||||
updateDate: new Date('2024-01-02'),
|
||||
url: 'https://test.org',
|
||||
userinorg: 5,
|
||||
maxOrganizationalDecks: 10,
|
||||
users: [
|
||||
{ id: 'user-1', name: 'User One' },
|
||||
{ id: 'user-2', name: 'User Two' }
|
||||
@@ -85,9 +86,10 @@ describe('OrganizationMapper', () => {
|
||||
contactemail: 'john@test.org',
|
||||
state: OrganizationState.ACTIVE,
|
||||
regdate: new Date('2024-01-01'),
|
||||
updatedate: new Date('2024-01-02'),
|
||||
updateDate: new Date('2024-01-02'),
|
||||
url: 'https://test.org',
|
||||
userinorg: 5,
|
||||
maxOrganizationalDecks: 10,
|
||||
users: ['user-1', 'user-2']
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user