Accept current Summoner V4 responses
This commit is contained in:
1 parent
9d43cc266c
commit
38cb97d86a
2 files changed
+21
-2
No files matched your search
@@ -122,6 +122,25 @@ describe('RiotApiClient', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('accepts current Summoner-V4 by-puuid responses without legacy id fields', async () => {
|
||||
const fetchMock = createFetchMock().mockResolvedValue(
|
||||
jsonResponse({
|
||||
profileIconId: 7,
|
||||
puuid: 'puuid-1',
|
||||
revisionDate: 1_783_056_144_000,
|
||||
summonerLevel: 30,
|
||||
}),
|
||||
);
|
||||
const { client } = createClient(fetchMock);
|
||||
|
||||
await expect(client.getSummonerByPuuid('puuid-1', 'kr')).resolves.toEqual({
|
||||
profileIconId: 7,
|
||||
puuid: 'puuid-1',
|
||||
revisionDate: 1_783_056_144_000,
|
||||
summonerLevel: 30,
|
||||
});
|
||||
});
|
||||
|
||||
it('honors Retry-After for 429 responses and retries', async () => {
|
||||
const sleep = jest
|
||||
.fn<Promise<void>, [number]>()
|
||||
|
||||
Reference in new issue
Block a user