test apps api
This commit is contained in:
@@ -13,12 +13,17 @@ describe('GetLeagueMembershipsPresenter', () => {
|
||||
membership: {
|
||||
driverId: 'driver-1',
|
||||
role: 'member',
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
joinedAt: {} as any,
|
||||
joinedAt: { toDate: () => new Date('2024-01-01T00:00:00Z') },
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
driver: { id: 'driver-1', name: 'John Doe' } as any,
|
||||
driver: {
|
||||
id: 'driver-1',
|
||||
iracingId: '12345',
|
||||
name: 'John Doe',
|
||||
country: 'US',
|
||||
joinedAt: { toDate: () => new Date('2024-01-01T00:00:00Z') },
|
||||
} as any,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -10,15 +10,20 @@ export class GetLeagueSeasonsPresenter implements Presenter<GetLeagueSeasonsResu
|
||||
}
|
||||
|
||||
present(input: GetLeagueSeasonsResult) {
|
||||
this.result = input.seasons.map(seasonSummary => ({
|
||||
seasonId: seasonSummary.season.id.toString(),
|
||||
name: seasonSummary.season.name.toString(),
|
||||
status: seasonSummary.season.status.toString(),
|
||||
startDate: seasonSummary.season.startDate.toISOString(),
|
||||
endDate: seasonSummary.season.endDate?.toISOString(),
|
||||
isPrimary: seasonSummary.isPrimary,
|
||||
isParallelActive: seasonSummary.isParallelActive,
|
||||
}));
|
||||
this.result = input.seasons.map((seasonSummary) => {
|
||||
const dto = new LeagueSeasonSummaryDTO();
|
||||
dto.seasonId = seasonSummary.season.id.toString();
|
||||
dto.name = seasonSummary.season.name.toString();
|
||||
dto.status = seasonSummary.season.status.toString();
|
||||
|
||||
if (seasonSummary.season.startDate) dto.startDate = seasonSummary.season.startDate;
|
||||
if (seasonSummary.season.endDate) dto.endDate = seasonSummary.season.endDate;
|
||||
|
||||
dto.isPrimary = seasonSummary.isPrimary;
|
||||
dto.isParallelActive = seasonSummary.isParallelActive;
|
||||
|
||||
return dto;
|
||||
});
|
||||
}
|
||||
|
||||
getResponseModel(): LeagueSeasonSummaryDTO[] | null {
|
||||
|
||||
@@ -14,8 +14,7 @@ describe('LeagueOwnerSummaryPresenter', () => {
|
||||
name: 'John Doe',
|
||||
country: 'US',
|
||||
bio: 'Racing enthusiast',
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
joinedAt: {} as any,
|
||||
joinedAt: { toDate: () => new Date('2024-01-01T00:00:00Z') } as any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any,
|
||||
rating: 1500,
|
||||
|
||||
Reference in New Issue
Block a user