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

@@ -70,11 +70,11 @@ describe('GetLeagueScheduleUseCase', () => {
expect(output.present).toHaveBeenCalledTimes(1);
const presented =
output.present.mock.calls[0]![0] as GetLeagueScheduleResult;
output.present.mock.calls[0]?.[0] as GetLeagueScheduleResult;
expect(presented.league).toBe(league);
expect(presented.races).toHaveLength(1);
expect(presented.races[0].race).toBe(race);
expect(presented.races[0]?.race).toBe(race);
});
it('should present empty schedule when no races exist', async () => {
@@ -92,7 +92,7 @@ describe('GetLeagueScheduleUseCase', () => {
expect(output.present).toHaveBeenCalledTimes(1);
const presented =
output.present.mock.calls[0]![0] as GetLeagueScheduleResult;
output.present.mock.calls[0]?.[0] as GetLeagueScheduleResult;
expect(presented.league).toBe(league);
expect(presented.races).toHaveLength(0);
@@ -119,7 +119,7 @@ describe('GetLeagueScheduleUseCase', () => {
it('should return REPOSITORY_ERROR when repository throws', async () => {
const leagueId = 'league-1';
const league = { id: leagueId } as League;
const league = { id: leagueId } as unknown as League;
const repositoryError = new Error('DB down');
leagueRepository.findById.mockResolvedValue(league);