move static data
This commit is contained in:
@@ -9,8 +9,9 @@ describe('PenaltyService', () => {
|
||||
beforeEach(() => {
|
||||
mockApiClient = {
|
||||
getRacePenalties: vi.fn(),
|
||||
getPenaltyTypesReference: vi.fn(),
|
||||
applyPenalty: vi.fn(),
|
||||
} as Mocked<PenaltiesApiClient>;
|
||||
} as unknown as Mocked<PenaltiesApiClient>;
|
||||
|
||||
service = new PenaltyService(mockApiClient);
|
||||
});
|
||||
@@ -23,9 +24,10 @@ describe('PenaltyService', () => {
|
||||
{ id: 'penalty-1', driverId: 'driver-1', type: 'time', value: 5, reason: 'Incident' },
|
||||
{ id: 'penalty-2', driverId: 'driver-2', type: 'grid', value: 3, reason: 'Qualifying incident' },
|
||||
],
|
||||
driverMap: {},
|
||||
};
|
||||
|
||||
mockApiClient.getRacePenalties.mockResolvedValue(mockDto);
|
||||
mockApiClient.getRacePenalties.mockResolvedValue(mockDto as any);
|
||||
|
||||
const result = await service.findByRaceId(raceId);
|
||||
|
||||
@@ -36,9 +38,9 @@ describe('PenaltyService', () => {
|
||||
|
||||
it('should handle empty penalties array', async () => {
|
||||
const raceId = 'race-123';
|
||||
const mockDto = { penalties: [] };
|
||||
const mockDto = { penalties: [], driverMap: {} };
|
||||
|
||||
mockApiClient.getRacePenalties.mockResolvedValue(mockDto);
|
||||
mockApiClient.getRacePenalties.mockResolvedValue(mockDto as any);
|
||||
|
||||
const result = await service.findByRaceId(raceId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user