fix issues in core
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user