code quality
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
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
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
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:
@@ -8,6 +8,8 @@ import { Driver } from '../../../racing/domain/entities/Driver';
|
||||
import { Race } from '../../../racing/domain/entities/Race';
|
||||
import { Result } from '../../../racing/domain/entities/result/Result';
|
||||
import { Rating } from '../../domain/Rating';
|
||||
import { DriverId } from '../../../racing/domain/entities/DriverId';
|
||||
import { RaceId } from '../../../racing/domain/entities/RaceId';
|
||||
|
||||
const mockRatingRepository = {
|
||||
findByDriverAndRace: vi.fn(),
|
||||
@@ -92,8 +94,8 @@ describe('CalculateTeamContributionUseCase', () => {
|
||||
const points = 12.5; // 50% contribution
|
||||
|
||||
const existingRating = Rating.create({
|
||||
driverId: 'driver-1' as any, // Simplified for test
|
||||
raceId: 'race-1' as any,
|
||||
driverId: DriverId.create('driver-1'),
|
||||
raceId: RaceId.create('race-1'),
|
||||
rating: 1500,
|
||||
components: {
|
||||
resultsStrength: 80,
|
||||
@@ -106,10 +108,10 @@ describe('CalculateTeamContributionUseCase', () => {
|
||||
timestamp: new Date('2023-01-01')
|
||||
});
|
||||
|
||||
mockDriverRepository.findById.mockResolvedValue({ id: driverId } as any);
|
||||
mockRaceRepository.findById.mockResolvedValue({ id: raceId } as any);
|
||||
mockDriverRepository.findById.mockResolvedValue({ id: driverId });
|
||||
mockRaceRepository.findById.mockResolvedValue({ id: raceId });
|
||||
mockResultRepository.findByRaceId.mockResolvedValue([
|
||||
{ driverId: { toString: () => driverId }, points } as any
|
||||
{ driverId: { toString: () => driverId }, points }
|
||||
]);
|
||||
mockRatingRepository.findByDriverAndRace.mockResolvedValue(existingRating);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user