fix issues in core
This commit is contained in:
@@ -16,6 +16,8 @@ import type { FeedItem } from '@core/social/domain/types/FeedItem';
|
||||
import { Result as UseCaseResult } from '@core/shared/application/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
|
||||
import { JoinRequest } from '@core/racing/domain/entities/JoinRequest';
|
||||
import { RaceRegistration } from '@core/racing/domain/entities/RaceRegistration';
|
||||
|
||||
describe('DashboardOverviewUseCase', () => {
|
||||
it('partitions upcoming races into myUpcomingRaces and otherUpcomingRaces and selects nextRace from myUpcomingRaces', async () => {
|
||||
@@ -195,14 +197,14 @@ describe('DashboardOverviewUseCase', () => {
|
||||
);
|
||||
},
|
||||
getLeagueMembers: async (): Promise<LeagueMembership[]> => [],
|
||||
getJoinRequests: async (): Promise<any[]> => [],
|
||||
getJoinRequests: async (): Promise<JoinRequest[]> => [],
|
||||
saveMembership: async (): Promise<LeagueMembership> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
removeMembership: async (): Promise<void> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
saveJoinRequest: async (): Promise<any> => {
|
||||
saveJoinRequest: async (): Promise<JoinRequest> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
removeJoinRequest: async (): Promise<void> => {
|
||||
@@ -227,7 +229,7 @@ describe('DashboardOverviewUseCase', () => {
|
||||
clearRaceRegistrations: async (): Promise<void> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
findByRaceId: async (): Promise<any[]> => [],
|
||||
findByRaceId: async (): Promise<RaceRegistration[]> => [],
|
||||
};
|
||||
|
||||
const feedRepository = {
|
||||
@@ -289,9 +291,9 @@ describe('DashboardOverviewUseCase', () => {
|
||||
expect(_presentedData).not.toBeNull();
|
||||
const vm = _presentedData!;
|
||||
|
||||
expect(vm.myUpcomingRaces.map((r: any) => r.race.id)).toEqual(['race-1', 'race-3']);
|
||||
expect(vm.myUpcomingRaces.map(r => r.race.id)).toEqual(['race-1', 'race-3']);
|
||||
|
||||
expect(vm.otherUpcomingRaces.map((r: any) => r.race.id)).toEqual(['race-2', 'race-4']);
|
||||
expect(vm.otherUpcomingRaces.map(r => r.race.id)).toEqual(['race-2', 'race-4']);
|
||||
|
||||
expect(vm.nextRace).not.toBeNull();
|
||||
expect(vm.nextRace!.race.id).toBe('race-1');
|
||||
@@ -482,14 +484,14 @@ describe('DashboardOverviewUseCase', () => {
|
||||
);
|
||||
},
|
||||
getLeagueMembers: async (): Promise<LeagueMembership[]> => [],
|
||||
getJoinRequests: async (): Promise<any[]> => [],
|
||||
getJoinRequests: async (): Promise<JoinRequest[]> => [],
|
||||
saveMembership: async (): Promise<LeagueMembership> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
removeMembership: async (): Promise<void> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
saveJoinRequest: async (): Promise<any> => {
|
||||
saveJoinRequest: async (): Promise<JoinRequest> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
removeJoinRequest: async (): Promise<void> => {
|
||||
@@ -511,7 +513,7 @@ describe('DashboardOverviewUseCase', () => {
|
||||
clearRaceRegistrations: async (): Promise<void> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
findByRaceId: async (): Promise<any[]> => [],
|
||||
findByRaceId: async (): Promise<RaceRegistration[]> => [],
|
||||
};
|
||||
|
||||
const feedRepository = {
|
||||
@@ -578,7 +580,7 @@ describe('DashboardOverviewUseCase', () => {
|
||||
expect(vm.recentResults[1]!.race.id).toBe('race-old');
|
||||
|
||||
const summariesByLeague = new Map(
|
||||
vm.leagueStandingsSummaries.map((s: any) => [s.league.id.toString(), s]),
|
||||
vm.leagueStandingsSummaries.map(s => [s.league.id.toString(), s] as const),
|
||||
);
|
||||
|
||||
const summaryA = summariesByLeague.get('league-A');
|
||||
@@ -702,14 +704,14 @@ describe('DashboardOverviewUseCase', () => {
|
||||
const leagueMembershipRepository = {
|
||||
getMembership: async (): Promise<LeagueMembership | null> => null,
|
||||
getLeagueMembers: async (): Promise<LeagueMembership[]> => [],
|
||||
getJoinRequests: async (): Promise<any[]> => [],
|
||||
getJoinRequests: async (): Promise<JoinRequest[]> => [],
|
||||
saveMembership: async (): Promise<LeagueMembership> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
removeMembership: async (): Promise<void> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
saveJoinRequest: async (): Promise<any> => {
|
||||
saveJoinRequest: async (): Promise<JoinRequest> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
removeJoinRequest: async (): Promise<void> => {
|
||||
@@ -731,7 +733,7 @@ describe('DashboardOverviewUseCase', () => {
|
||||
clearRaceRegistrations: async (): Promise<void> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
findByRaceId: async (): Promise<any[]> => [],
|
||||
findByRaceId: async (): Promise<RaceRegistration[]> => [],
|
||||
};
|
||||
|
||||
const feedRepository = {
|
||||
@@ -898,14 +900,14 @@ describe('DashboardOverviewUseCase', () => {
|
||||
const leagueMembershipRepository = {
|
||||
getMembership: async (): Promise<LeagueMembership | null> => null,
|
||||
getLeagueMembers: async (): Promise<LeagueMembership[]> => [],
|
||||
getJoinRequests: async (): Promise<any[]> => [],
|
||||
getJoinRequests: async (): Promise<JoinRequest[]> => [],
|
||||
saveMembership: async (): Promise<LeagueMembership> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
removeMembership: async (): Promise<void> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
saveJoinRequest: async (): Promise<any> => {
|
||||
saveJoinRequest: async (): Promise<JoinRequest> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
removeJoinRequest: async (): Promise<void> => {
|
||||
@@ -927,7 +929,7 @@ describe('DashboardOverviewUseCase', () => {
|
||||
clearRaceRegistrations: async (): Promise<void> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
findByRaceId: async (): Promise<any[]> => [],
|
||||
findByRaceId: async (): Promise<RaceRegistration[]> => [],
|
||||
};
|
||||
|
||||
const feedRepository = {
|
||||
@@ -1089,14 +1091,14 @@ describe('DashboardOverviewUseCase', () => {
|
||||
const leagueMembershipRepository = {
|
||||
getMembership: async (): Promise<LeagueMembership | null> => null,
|
||||
getLeagueMembers: async (): Promise<LeagueMembership[]> => [],
|
||||
getJoinRequests: async (): Promise<any[]> => [],
|
||||
getJoinRequests: async (): Promise<JoinRequest[]> => [],
|
||||
saveMembership: async (): Promise<LeagueMembership> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
removeMembership: async (): Promise<void> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
saveJoinRequest: async (): Promise<any> => {
|
||||
saveJoinRequest: async (): Promise<JoinRequest> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
removeJoinRequest: async (): Promise<void> => {
|
||||
@@ -1118,7 +1120,7 @@ describe('DashboardOverviewUseCase', () => {
|
||||
clearRaceRegistrations: async (): Promise<void> => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
findByRaceId: async (): Promise<any[]> => [],
|
||||
findByRaceId: async (): Promise<RaceRegistration[]> => [],
|
||||
};
|
||||
|
||||
const feedRepository = {
|
||||
|
||||
Reference in New Issue
Block a user