import { RiotClientService } from './riot.client.service'; import { RiotLeagueService } from './riot-league.service'; import type { RiotLeagueEntryDto, RiotResponseParser } from './riot.types'; describe('RiotLeagueService', () => { it('accepts Riot league entries without optional leagueId', async () => { const client = { get: jest.fn( async ( _path: string, _options: unknown, parser?: RiotResponseParser, ) => parser ? parser([ { queueType: 'RANKED_SOLO_5x5', tier: 'EMERALD', rank: 'I', puuid: 'puuid-1', leaguePoints: 75, wins: 160, losses: 148, }, ]) : ([] as T), ), } as unknown as RiotClientService; const service = new RiotLeagueService(client); const result = await service.getEntriesByPuuid('puuid-1', { platform: 'kr', }); expect(result).toEqual([ { queueType: 'RANKED_SOLO_5x5', tier: 'EMERALD', rank: 'I', puuid: 'puuid-1', leaguePoints: 75, wins: 160, losses: 148, }, ]); }); });