integration tests
Some checks failed
CI / lint-typecheck (pull_request) Failing after 4m50s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped

This commit is contained in:
2026-01-23 11:44:59 +01:00
parent a0f41f242f
commit 6df38a462a
125 changed files with 4712 additions and 19184 deletions

View File

@@ -18,6 +18,12 @@ export class InMemoryAvatarGenerationRepository implements AvatarGenerationRepos
}
}
clear(): void {
this.requests.clear();
this.userRequests.clear();
this.logger.info('InMemoryAvatarGenerationRepository cleared.');
}
async save(request: AvatarGenerationRequest): Promise<void> {
this.logger.debug(`[InMemoryAvatarGenerationRepository] Saving avatar generation request: ${request.id} for user ${request.userId}.`);
this.requests.set(request.id, request);

View File

@@ -0,0 +1,22 @@
import type { AvatarGenerationPort, AvatarGenerationOptions, AvatarGenerationResult } from '@core/media/application/ports/AvatarGenerationPort';
import type { Logger } from '@core/shared/domain/Logger';
export class InMemoryAvatarGenerationAdapter implements AvatarGenerationPort {
constructor(private readonly logger: Logger) {
this.logger.info('InMemoryAvatarGenerationAdapter initialized.');
}
async generateAvatars(options: AvatarGenerationOptions): Promise<AvatarGenerationResult> {
this.logger.debug('[InMemoryAvatarGenerationAdapter] Generating avatars (mock).', { options });
const avatars = Array.from({ length: options.count }, (_, i) => ({
url: `https://example.com/generated-avatar-${i + 1}.png`,
thumbnailUrl: `https://example.com/generated-avatar-${i + 1}-thumb.png`,
}));
return Promise.resolve({
success: true,
avatars,
});
}
}

View File

@@ -29,7 +29,7 @@ export class InMemoryMediaStorageAdapter implements MediaStoragePort {
}
// Generate storage key
const storageKey = `uploaded/${Date.now()}-${options.filename.replace(/[^a-zA-Z0-9.-]/g, '_')}`;
const storageKey = `/media/uploaded/${Date.now()}-${options.filename.replace(/[^a-zA-Z0-9.-]/g, '_')}`;
// Store buffer and metadata
this.storage.set(storageKey, buffer);