wip
This commit is contained in:
@@ -285,10 +285,31 @@ describe('ImportRaceResultsUseCase', () => {
|
||||
|
||||
const presenter = new FakeImportRaceResultsPresenter();
|
||||
|
||||
const driverRepository = {
|
||||
findById: async (): Promise<Driver | null> => null,
|
||||
findByIRacingId: async (iracingId: string): Promise<Driver | null> => {
|
||||
// Mock finding driver by iracingId
|
||||
if (iracingId === 'driver-1') {
|
||||
return Driver.create({ id: 'driver-1', iracingId: 'driver-1', name: 'Driver One', country: 'US' });
|
||||
}
|
||||
if (iracingId === 'driver-2') {
|
||||
return Driver.create({ id: 'driver-2', iracingId: 'driver-2', name: 'Driver Two', country: 'GB' });
|
||||
}
|
||||
return null;
|
||||
},
|
||||
findAll: async (): Promise<Driver[]> => [],
|
||||
create: async (): Promise<Driver> => { throw new Error('Not implemented'); },
|
||||
update: async (): Promise<Driver> => { throw new Error('Not implemented'); },
|
||||
delete: async (): Promise<void> => { throw new Error('Not implemented'); },
|
||||
exists: async (): Promise<boolean> => false,
|
||||
existsByIRacingId: async (): Promise<boolean> => false,
|
||||
};
|
||||
|
||||
const useCase = new ImportRaceResultsUseCase(
|
||||
raceRepository,
|
||||
leagueRepository,
|
||||
resultRepository,
|
||||
driverRepository,
|
||||
standingRepository,
|
||||
presenter,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user