fix issues in core

This commit is contained in:
2025-12-23 14:43:49 +01:00
parent 11492d1ff2
commit df5c20c5cc
62 changed files with 480 additions and 334 deletions

View File

@@ -3,19 +3,19 @@ import {
GetDriversLeaderboardUseCase,
type GetDriversLeaderboardResult,
type GetDriversLeaderboardInput,
type GetDriversLeaderboardErrorCode,
} from './GetDriversLeaderboardUseCase';
import type { IDriverRepository } from '../../domain/repositories/IDriverRepository';
import type { IRankingService } from '../../domain/services/IRankingService';
import type { IDriverStatsService } from '../../domain/services/IDriverStatsService';
import type { Logger } from '@core/shared/application';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
describe('GetDriversLeaderboardUseCase', () => {
const mockDriverFindAll = vi.fn();
const mockDriverRepo: IDriverRepository = {
findById: vi.fn(),
findByIRacingId: vi.fn(),
existsByIRacingId: vi.fn(),
findAll: mockDriverFindAll,
create: vi.fn(),
update: vi.fn(),
@@ -57,7 +57,6 @@ describe('GetDriversLeaderboardUseCase', () => {
mockDriverStatsService,
mockGetDriverAvatar,
mockLogger,
output,
);
const driver1 = { id: 'driver1', name: { value: 'Driver One' }, country: { value: 'US' } };
@@ -99,7 +98,7 @@ describe('GetDriversLeaderboardUseCase', () => {
rating: 2500,
skillLevel: 'advanced',
racesCompleted: 10,
wins: 5,
wins:5,
podiums: 7,
isActive: true,
rank: 1,
@@ -130,7 +129,6 @@ describe('GetDriversLeaderboardUseCase', () => {
mockDriverStatsService,
mockGetDriverAvatar,
mockLogger,
output,
);
mockDriverFindAll.mockResolvedValue([]);
@@ -161,7 +159,6 @@ describe('GetDriversLeaderboardUseCase', () => {
mockDriverStatsService,
mockGetDriverAvatar,
mockLogger,
output,
);
const driver1 = { id: 'driver1', name: { value: 'Driver One' }, country: { value: 'US' } };
@@ -209,7 +206,6 @@ describe('GetDriversLeaderboardUseCase', () => {
mockDriverStatsService,
mockGetDriverAvatar,
mockLogger,
output,
);
const error = new Error('Repository error');