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

@@ -111,15 +111,15 @@ describe('GetLeagueProtestsUseCase', () => {
expect(result.unwrap()).toBeUndefined();
expect(output.present).toHaveBeenCalledTimes(1);
const presented = output.present.mock.calls[0][0] as GetLeagueProtestsResult;
const presented = output.present.mock.calls[0]?.[0] as GetLeagueProtestsResult;
expect(presented.league).toEqual(league);
expect(presented.protests).toHaveLength(1);
const presentedProtest = presented.protests[0];
expect(presentedProtest.protest).toEqual(protest);
expect(presentedProtest.race).toEqual(race);
expect(presentedProtest.protestingDriver).toEqual(driver1);
expect(presentedProtest.accusedDriver).toEqual(driver2);
expect(presented?.league).toEqual(league);
expect(presented?.protests).toHaveLength(1);
const presentedProtest = presented?.protests[0];
expect(presentedProtest?.protest).toEqual(protest);
expect(presentedProtest?.race).toEqual(race);
expect(presentedProtest?.protestingDriver).toEqual(driver1);
expect(presentedProtest?.accusedDriver).toEqual(driver2);
});
it('should return empty protests when no races', async () => {
@@ -141,10 +141,10 @@ describe('GetLeagueProtestsUseCase', () => {
expect(result.unwrap()).toBeUndefined();
expect(output.present).toHaveBeenCalledTimes(1);
const presented = output.present.mock.calls[0][0] as GetLeagueProtestsResult;
const presented = output.present.mock.calls[0]?.[0] as GetLeagueProtestsResult;
expect(presented.league).toEqual(league);
expect(presented.protests).toEqual([]);
expect(presented?.league).toEqual(league);
expect(presented?.protests).toEqual([]);
});
it('should return LEAGUE_NOT_FOUND when league does not exist', async () => {