diff --git a/src/features/Pokedex/__test__/pokedexApi.test.ts b/src/features/Pokedex/__test__/pokedexApi.test.ts index ce5e472..432528c 100644 --- a/src/features/Pokedex/__test__/pokedexApi.test.ts +++ b/src/features/Pokedex/__test__/pokedexApi.test.ts @@ -114,5 +114,16 @@ describe('pokedexApi', () => { // @ts-ignore expect(pokemonListData?.previous).toBeUndefined(); }); + + test('query getRegionPokemonList for kanto should return correct data in list', async () => { + await store.dispatch( + pokedexApi.endpoints.getRegionPokemonList.initiate('johto'), + ); + + const pokemonListData = pokedexApi.endpoints.getRegionPokemonList.select( + 'johto', + )(store.getState()).data; + expect(pokemonListData).toHaveLength(19); + }, 100000000000); }); }); diff --git a/src/features/Pokedex/__test__/responses/area_blackthorn-city-area.json b/src/features/Pokedex/__test__/responses/area_blackthorn-city-area.json new file mode 100644 index 0000000..6ce28f2 --- /dev/null +++ b/src/features/Pokedex/__test__/responses/area_blackthorn-city-area.json @@ -0,0 +1,1036 @@ +{ + "encounter_method_rates": [ + { + "encounter_method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "version_details": [ + { + "rate": 25, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "rate": 25, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "encounter_method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "version_details": [ + { + "rate": 50, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "rate": 50, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "encounter_method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "version_details": [ + { + "rate": 75, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "rate": 75, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "encounter_method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "version_details": [ + { + "rate": 10, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "rate": 10, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + } + ], + "game_index": 66, + "id": 249, + "location": { + "name": "blackthorn-city", + "url": "https://pokeapi.co/api/v2/location/65/" + }, + "name": "blackthorn-city-area", + "names": [ + { + "language": { + "name": "en", + "url": "https://pokeapi.co/api/v2/language/9/" + }, + "name": "Blackthorn City" + } + ], + "pokemon_encounters": [ + { + "pokemon": { + "name": "poliwag", + "url": "https://pokeapi.co/api/v2/pokemon/60/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 15, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 35, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 20, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 40, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + } + ], + "max_chance": 160, + "version": { + "name": "gold", + "url": "https://pokeapi.co/api/v2/version/4/" + } + }, + { + "encounter_details": [ + { + "chance": 15, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 35, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 20, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 40, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + } + ], + "max_chance": 160, + "version": { + "name": "silver", + "url": "https://pokeapi.co/api/v2/version/5/" + } + }, + { + "encounter_details": [ + { + "chance": 15, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 35, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 20, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 40, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + } + ], + "max_chance": 160, + "version": { + "name": "crystal", + "url": "https://pokeapi.co/api/v2/version/6/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 15, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 40, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + } + ], + "max_chance": 155, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 15, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 40, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + } + ], + "max_chance": 155, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "magikarp", + "url": "https://pokeapi.co/api/v2/pokemon/129/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 70, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 15, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 35, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 20, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 60, + "condition_values": [], + "max_level": 19, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 15 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 14, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 10 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 9, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 5 + } + ], + "max_chance": 240, + "version": { + "name": "gold", + "url": "https://pokeapi.co/api/v2/version/4/" + } + }, + { + "encounter_details": [ + { + "chance": 70, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 15, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 35, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 20, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 60, + "condition_values": [], + "max_level": 19, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 15 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 14, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 10 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 9, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 5 + } + ], + "max_chance": 240, + "version": { + "name": "silver", + "url": "https://pokeapi.co/api/v2/version/5/" + } + }, + { + "encounter_details": [ + { + "chance": 70, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 15, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 35, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 20, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 60, + "condition_values": [], + "max_level": 19, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 15 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 14, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 10 + }, + { + "chance": 10, + "condition_values": [], + "max_level": 9, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 5 + } + ], + "max_chance": 240, + "version": { + "name": "crystal", + "url": "https://pokeapi.co/api/v2/version/6/" + } + }, + { + "encounter_details": [ + { + "chance": 60, + "condition_values": [], + "max_level": 20, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 10 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 15, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 5 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 10, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 2 + }, + { + "chance": 4, + "condition_values": [], + "max_level": 10, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 2 + }, + { + "chance": 1, + "condition_values": [], + "max_level": 10, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 2 + }, + { + "chance": 40, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 15, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 40, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 15, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + } + ], + "max_chance": 245, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 60, + "condition_values": [], + "max_level": 20, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 10 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 15, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 5 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 10, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 2 + }, + { + "chance": 4, + "condition_values": [], + "max_level": 10, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 2 + }, + { + "chance": 1, + "condition_values": [], + "max_level": 10, + "method": { + "name": "surf", + "url": "https://pokeapi.co/api/v2/encounter-method/5/" + }, + "min_level": 2 + }, + { + "chance": 40, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 30, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 15, + "condition_values": [], + "max_level": 10, + "method": { + "name": "old-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/2/" + }, + "min_level": 10 + }, + { + "chance": 40, + "condition_values": [], + "max_level": 20, + "method": { + "name": "good-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/3/" + }, + "min_level": 20 + }, + { + "chance": 15, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 40, + "method": { + "name": "super-rod", + "url": "https://pokeapi.co/api/v2/encounter-method/4/" + }, + "min_level": 40 + } + ], + "max_chance": 245, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + } + ] +} diff --git a/src/features/Pokedex/__test__/responses/area_burned-tower-1f.json b/src/features/Pokedex/__test__/responses/area_burned-tower-1f.json new file mode 100644 index 0000000..59f0b7c --- /dev/null +++ b/src/features/Pokedex/__test__/responses/area_burned-tower-1f.json @@ -0,0 +1,1090 @@ +{ + "encounter_method_rates": [ + { + "encounter_method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "version_details": [ + { + "rate": 10, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "rate": 10, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + } + ], + "game_index": 29, + "id": 212, + "location": { + "name": "burned-tower", + "url": "https://pokeapi.co/api/v2/location/66/" + }, + "name": "burned-tower-1f", + "names": [ + { + "language": { + "name": "en", + "url": "https://pokeapi.co/api/v2/language/9/" + }, + "name": "Burned Tower (1F)" + } + ], + "pokemon_encounters": [ + { + "pokemon": { + "name": "rattata", + "url": "https://pokeapi.co/api/v2/pokemon/19/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [], + "max_level": 13, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 13 + }, + { + "chance": 20, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 50, + "version": { + "name": "gold", + "url": "https://pokeapi.co/api/v2/version/4/" + } + }, + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [], + "max_level": 13, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 13 + }, + { + "chance": 20, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 50, + "version": { + "name": "silver", + "url": "https://pokeapi.co/api/v2/version/5/" + } + }, + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [], + "max_level": 13, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 13 + }, + { + "chance": 20, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 55, + "version": { + "name": "crystal", + "url": "https://pokeapi.co/api/v2/version/6/" + } + }, + { + "encounter_details": [ + { + "chance": 20, + "condition_values": [], + "max_level": 13, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 13 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 13, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 13 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 50, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 20, + "condition_values": [], + "max_level": 13, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 13 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 13, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 13 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 50, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "raticate", + "url": "https://pokeapi.co/api/v2/pokemon/20/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 4, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 1, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 5, + "version": { + "name": "gold", + "url": "https://pokeapi.co/api/v2/version/4/" + } + }, + { + "encounter_details": [ + { + "chance": 4, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 1, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 5, + "version": { + "name": "silver", + "url": "https://pokeapi.co/api/v2/version/5/" + } + }, + { + "encounter_details": [ + { + "chance": 4, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 1, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 5, + "version": { + "name": "crystal", + "url": "https://pokeapi.co/api/v2/version/6/" + } + }, + { + "encounter_details": [ + { + "chance": 4, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 1, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 5, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 4, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 1, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 5, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "zubat", + "url": "https://pokeapi.co/api/v2/pokemon/41/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 10, + "version": { + "name": "gold", + "url": "https://pokeapi.co/api/v2/version/4/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 10, + "version": { + "name": "silver", + "url": "https://pokeapi.co/api/v2/version/5/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 10, + "version": { + "name": "crystal", + "url": "https://pokeapi.co/api/v2/version/6/" + } + }, + { + "encounter_details": [ + { + "chance": 5, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 10, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 5, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 10, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "koffing", + "url": "https://pokeapi.co/api/v2/pokemon/109/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 35, + "version": { + "name": "gold", + "url": "https://pokeapi.co/api/v2/version/4/" + } + }, + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 35, + "version": { + "name": "silver", + "url": "https://pokeapi.co/api/v2/version/5/" + } + }, + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 30, + "version": { + "name": "crystal", + "url": "https://pokeapi.co/api/v2/version/6/" + } + }, + { + "encounter_details": [ + { + "chance": 20, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 4, + "condition_values": [], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 1, + "condition_values": [], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 35, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 20, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 4, + "condition_values": [], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 1, + "condition_values": [], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 35, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "zigzagoon", + "url": "https://pokeapi.co/api/v2/pokemon/263/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 13, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 13 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 20, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 13, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 13 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 20, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "meditite", + "url": "https://pokeapi.co/api/v2/pokemon/307/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 20, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 20, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "spinda", + "url": "https://pokeapi.co/api/v2/pokemon/327/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 20, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 20, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "chatot", + "url": "https://pokeapi.co/api/v2/pokemon/441/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 13, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 13 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 20, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 13, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 13 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 20, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + } + ] +} diff --git a/src/features/Pokedex/__test__/responses/area_burned-tower-b1f.json b/src/features/Pokedex/__test__/responses/area_burned-tower-b1f.json new file mode 100644 index 0000000..49ad105 --- /dev/null +++ b/src/features/Pokedex/__test__/responses/area_burned-tower-b1f.json @@ -0,0 +1,1868 @@ +{ + "encounter_method_rates": [ + { + "encounter_method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "version_details": [ + { + "rate": 10, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "rate": 10, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + } + ], + "game_index": 30, + "id": 213, + "location": { + "name": "burned-tower", + "url": "https://pokeapi.co/api/v2/location/66/" + }, + "name": "burned-tower-b1f", + "names": [ + { + "language": { + "name": "en", + "url": "https://pokeapi.co/api/v2/language/9/" + }, + "name": "Burned Tower (B1F)" + } + ], + "pokemon_encounters": [ + { + "pokemon": { + "name": "rattata", + "url": "https://pokeapi.co/api/v2/pokemon/19/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 30, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 30, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 110, + "version": { + "name": "gold", + "url": "https://pokeapi.co/api/v2/version/4/" + } + }, + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 30, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 30, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 110, + "version": { + "name": "silver", + "url": "https://pokeapi.co/api/v2/version/5/" + } + }, + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 30, + "version": { + "name": "crystal", + "url": "https://pokeapi.co/api/v2/version/6/" + } + }, + { + "encounter_details": [ + { + "chance": 20, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 55, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 20, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 55, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "zubat", + "url": "https://pokeapi.co/api/v2/pokemon/41/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 5, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 15, + "version": { + "name": "gold", + "url": "https://pokeapi.co/api/v2/version/4/" + } + }, + { + "encounter_details": [ + { + "chance": 5, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 15, + "version": { + "name": "silver", + "url": "https://pokeapi.co/api/v2/version/5/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 10, + "version": { + "name": "crystal", + "url": "https://pokeapi.co/api/v2/version/6/" + } + }, + { + "encounter_details": [ + { + "chance": 4, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 1, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 5, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 4, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + }, + { + "chance": 1, + "condition_values": [], + "max_level": 15, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 15 + } + ], + "max_chance": 5, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "koffing", + "url": "https://pokeapi.co/api/v2/pokemon/109/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 20, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 30, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 20, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 30, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 20, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 150, + "version": { + "name": "gold", + "url": "https://pokeapi.co/api/v2/version/4/" + } + }, + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 20, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 30, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 20, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 30, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 20, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 150, + "version": { + "name": "silver", + "url": "https://pokeapi.co/api/v2/version/5/" + } + }, + { + "encounter_details": [ + { + "chance": 30, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 20, + "condition_values": [], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 5, + "condition_values": [], + "max_level": 12, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 12 + }, + { + "chance": 4, + "condition_values": [], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 59, + "version": { + "name": "crystal", + "url": "https://pokeapi.co/api/v2/version/6/" + } + }, + { + "encounter_details": [ + { + "chance": 20, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 50, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 20, + "condition_values": [], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-off", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/14/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 50, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "weezing", + "url": "https://pokeapi.co/api/v2/pokemon/110/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 1, + "condition_values": [], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 1, + "version": { + "name": "crystal", + "url": "https://pokeapi.co/api/v2/version/6/" + } + } + ] + }, + { + "pokemon": { + "name": "magmar", + "url": "https://pokeapi.co/api/v2/pokemon/126/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 25, + "version": { + "name": "gold", + "url": "https://pokeapi.co/api/v2/version/4/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 25, + "version": { + "name": "silver", + "url": "https://pokeapi.co/api/v2/version/5/" + } + }, + { + "encounter_details": [ + { + "chance": 5, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 20, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 5, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 5, + "condition_values": [ + { + "name": "time-day", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/4/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 4, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-morning", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/3/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 1, + "condition_values": [ + { + "name": "time-night", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/5/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 20, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "zigzagoon", + "url": "https://pokeapi.co/api/v2/pokemon/263/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 20, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 20, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "meditite", + "url": "https://pokeapi.co/api/v2/pokemon/307/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 20, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 20, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "spinda", + "url": "https://pokeapi.co/api/v2/pokemon/327/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 20, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-hoenn", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/15/" + } + ], + "max_level": 16, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 16 + } + ], + "max_chance": 20, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + }, + { + "pokemon": { + "name": "chatot", + "url": "https://pokeapi.co/api/v2/pokemon/441/" + }, + "version_details": [ + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 20, + "version": { + "name": "heartgold", + "url": "https://pokeapi.co/api/v2/version/15/" + } + }, + { + "encounter_details": [ + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + }, + { + "chance": 10, + "condition_values": [ + { + "name": "radio-sinnoh", + "url": "https://pokeapi.co/api/v2/encounter-condition-value/16/" + } + ], + "max_level": 14, + "method": { + "name": "walk", + "url": "https://pokeapi.co/api/v2/encounter-method/1/" + }, + "min_level": 14 + } + ], + "max_chance": 20, + "version": { + "name": "soulsilver", + "url": "https://pokeapi.co/api/v2/version/16/" + } + } + ] + } + ] +} diff --git a/src/features/Pokedex/__test__/responses/location_blackthorn-city.json b/src/features/Pokedex/__test__/responses/location_blackthorn-city.json new file mode 100644 index 0000000..98291ad --- /dev/null +++ b/src/features/Pokedex/__test__/responses/location_blackthorn-city.json @@ -0,0 +1,36 @@ +{ + "areas": [ + { + "name": "blackthorn-city-area", + "url": "https://pokeapi.co/api/v2/location-area/249/" + } + ], + "game_indices": [ + { + "game_index": 136, + "generation": { + "name": "generation-iv", + "url": "https://pokeapi.co/api/v2/generation/4/" + } + } + ], + "id": 65, + "name": "blackthorn-city", + "names": [ + { + "language": { + "name": "fr", + "url": "https://pokeapi.co/api/v2/language/5/" + }, + "name": "Ebènelle" + }, + { + "language": { + "name": "en", + "url": "https://pokeapi.co/api/v2/language/9/" + }, + "name": "Blackthorn City" + } + ], + "region": { "name": "johto", "url": "https://pokeapi.co/api/v2/region/2/" } +} diff --git a/src/features/Pokedex/__test__/responses/location_burned-tower.json b/src/features/Pokedex/__test__/responses/location_burned-tower.json new file mode 100644 index 0000000..4516602 --- /dev/null +++ b/src/features/Pokedex/__test__/responses/location_burned-tower.json @@ -0,0 +1,40 @@ +{ + "areas": [ + { + "name": "burned-tower-1f", + "url": "https://pokeapi.co/api/v2/location-area/212/" + }, + { + "name": "burned-tower-b1f", + "url": "https://pokeapi.co/api/v2/location-area/213/" + } + ], + "game_indices": [ + { + "game_index": 206, + "generation": { + "name": "generation-iv", + "url": "https://pokeapi.co/api/v2/generation/4/" + } + } + ], + "id": 66, + "name": "burned-tower", + "names": [ + { + "language": { + "name": "fr", + "url": "https://pokeapi.co/api/v2/language/5/" + }, + "name": "Tour Cendrée" + }, + { + "language": { + "name": "en", + "url": "https://pokeapi.co/api/v2/language/9/" + }, + "name": "Burned Tower" + } + ], + "region": { "name": "johto", "url": "https://pokeapi.co/api/v2/region/2/" } +} diff --git a/src/features/Pokedex/__test__/responses/region_johto.json b/src/features/Pokedex/__test__/responses/region_johto.json new file mode 100644 index 0000000..bff8e09 --- /dev/null +++ b/src/features/Pokedex/__test__/responses/region_johto.json @@ -0,0 +1,74 @@ +{ + "id": 2, + "locations": [ + { + "name": "blackthorn-city", + "url": "https://pokeapi.co/api/v2/location/65/" + }, + { "name": "burned-tower", "url": "https://pokeapi.co/api/v2/location/66/" } + ], + "main_generation": { + "name": "generation-ii", + "url": "https://pokeapi.co/api/v2/generation/2/" + }, + "name": "johto", + "names": [ + { + "language": { + "name": "ja-Hrkt", + "url": "https://pokeapi.co/api/v2/language/1/" + }, + "name": "ジョウト地方" + }, + { + "language": { + "name": "ko", + "url": "https://pokeapi.co/api/v2/language/3/" + }, + "name": "성도지방" + }, + { + "language": { + "name": "fr", + "url": "https://pokeapi.co/api/v2/language/5/" + }, + "name": "Johto" + }, + { + "language": { + "name": "de", + "url": "https://pokeapi.co/api/v2/language/6/" + }, + "name": "Johto" + }, + { + "language": { + "name": "it", + "url": "https://pokeapi.co/api/v2/language/8/" + }, + "name": "Johto" + }, + { + "language": { + "name": "en", + "url": "https://pokeapi.co/api/v2/language/9/" + }, + "name": "Johto" + } + ], + "pokedexes": [ + { "name": "original-johto", "url": "https://pokeapi.co/api/v2/pokedex/3/" }, + { "name": "updated-johto", "url": "https://pokeapi.co/api/v2/pokedex/7/" } + ], + "version_groups": [ + { + "name": "gold-silver", + "url": "https://pokeapi.co/api/v2/version-group/3/" + }, + { "name": "crystal", "url": "https://pokeapi.co/api/v2/version-group/4/" }, + { + "name": "heartgold-soulsilver", + "url": "https://pokeapi.co/api/v2/version-group/10/" + } + ] +} diff --git a/src/features/Pokedex/pokedexApi.ts b/src/features/Pokedex/pokedexApi.ts index 96f02e0..a3328ca 100644 --- a/src/features/Pokedex/pokedexApi.ts +++ b/src/features/Pokedex/pokedexApi.ts @@ -4,12 +4,17 @@ import { pokeApiFullListFetchArgs, } from './paginationBaseQuery'; import { + AreaResponseData, + LocationResponseData, PokemonListResponseData, PokemonResponseData, RegionListResponseData, RegionResponseData, TypeListResponseData, TypeResponseData, + PokemonListItem, + nameUrlPair, + PokemonList, } from './types/api'; const pokeApiBaseQuery = async ( @@ -54,6 +59,69 @@ export const pokedexApi = createApi({ getType: builder.query({ query: IdOrName => ({ url: `type/${IdOrName}` }), }), + getLocation: builder.query({ + query: IdOrName => ({ url: `location/${IdOrName}` }), + }), + getArea: builder.query({ + query: IdOrName => ({ url: `location-area/${IdOrName}` }), + }), + getRegionPokemonList: builder.query({ + async queryFn(regionIdOrName, api) { + // Get region data + const regionData: RegionResponseData = await api + .dispatch(pokedexApi.endpoints.getRegion.initiate(regionIdOrName)) + .unwrap(); + + // Get location data + const locationDataList: LocationResponseData[] = await Promise.all( + regionData.locations.map(location => + api + .dispatch( + pokedexApi.endpoints.getLocation.initiate(location.name), + ) + .unwrap(), + ), + ); + + // Get area datas + const areaDataList: AreaResponseData[] = await Promise.all( + locationDataList + .flatMap(locationData => locationData.areas) + .map(area => + api + .dispatch(pokedexApi.endpoints.getArea.initiate(area.name)) + .unwrap(), + ), + ); + + // Collect unique Pokemon + const uniquePokemonList = new Set(); + areaDataList.forEach(areaData => { + areaData.pokemon_encounters.forEach(pokemon => { + uniquePokemonList.add(pokemon.pokemon); + }); + }); + + // Get Pokemon data + const pokemonDataList: PokemonListItem[] = await Promise.all( + Array.from(uniquePokemonList).map(pokemon => + api + .dispatch(pokedexApi.endpoints.getPokemon.initiate(pokemon.name)) + .unwrap() + .then(pokemonData => { + return { + name: pokemonData.name, + id: pokemonData.id, + type: pokemonData.types.map(type => type.type.name), + image: pokemonData.sprites.other.dream_world.front_default, + }; + }), + ), + ); + + return { data: Array.from(pokemonDataList) }; + }, + }), }), }); @@ -64,4 +132,6 @@ export const { useGetPokemonQuery, useGetRegionQuery, useGetTypeQuery, + useGetAreaQuery, + useGetLocationQuery, } = pokedexApi; diff --git a/src/features/Pokedex/pokedexSlice.ts b/src/features/Pokedex/pokedexSlice.ts index e01111c..e0acc45 100644 --- a/src/features/Pokedex/pokedexSlice.ts +++ b/src/features/Pokedex/pokedexSlice.ts @@ -1,17 +1,20 @@ import { createSlice } from '@reduxjs/toolkit'; import type { PayloadAction } from '@reduxjs/toolkit'; +import { PokemonProps } from './Pokemon'; import type { RootState } from 'app/store'; interface PokedexState { selectedRegion: string; selectedType: string; selectedSort: string; + pokemonList: PokemonProps[]; } const initialState: PokedexState = { selectedRegion: '', selectedType: '', selectedSort: '', + pokemonList: [], }; export const pokedexSlice = createSlice({ diff --git a/src/features/Pokedex/types/api.ts b/src/features/Pokedex/types/api.ts index 17b664d..2d8b2a0 100644 --- a/src/features/Pokedex/types/api.ts +++ b/src/features/Pokedex/types/api.ts @@ -12,6 +12,17 @@ export type PokemonListResponseData = ListResponse; export type RegionListResponseData = ListResponse; export type TypeListResponseData = ListResponse; +export interface PokemonListItem { + name: string; + id: number; + type: string[]; + image: string; +} + +export interface PokemonList { + PokemonList: PokemonListItem[]; +} + export interface RegionResponseData { // many fields are ignored id: number; @@ -58,4 +69,32 @@ export interface PokemonResponseData { stats: StatItem[]; types: typeItem[]; weight: number; + sprites: { + back_default: string; + front_default: string; + other: { + dream_world: { + front_default: string; + }; + }; + }; +} + +export interface LocationResponseData { + // many fields are ignored + areas: nameUrlPair[]; + id: number; + name: string; + region: nameUrlPair; +} + +export interface PokemonEncounter { + // many fields are ignored + pokemon: nameUrlPair; +} +export interface AreaResponseData { + // many fields are ignored + id: number; + name: string; + pokemon_encounters: PokemonEncounter[]; } diff --git a/src/mocks/handlers.ts b/src/mocks/handlers.ts index 631f321..b7ef226 100644 --- a/src/mocks/handlers.ts +++ b/src/mocks/handlers.ts @@ -5,6 +5,12 @@ import regionList from 'features/Pokedex/__test__/responses/regionList.json'; import typeList from 'features/Pokedex/__test__/responses/typeList.json'; import pokemonListPg1 from 'features/Pokedex/__test__/responses/pokemonListPage1.json'; import pokemonListPg2 from 'features/Pokedex/__test__/responses/pokemonListPage2.json'; +import region_johto from 'features/Pokedex/__test__/responses/region_johto.json'; +import location_blackthorn_city from 'features/Pokedex/__test__/responses/location_blackthorn-city.json'; +import location_burned_tower from 'features/Pokedex/__test__/responses/location_burned-tower.json'; +import area_blackthorn_city_area from 'features/Pokedex/__test__/responses/area_blackthorn-city-area.json'; +import area_burned_tower_1f from 'features/Pokedex/__test__/responses/area_burned-tower-1f.json'; +import area_burned_tower_b1f from 'features/Pokedex/__test__/responses/area_burned-tower-b1f.json'; export const handlers = [ // mock https://pokeapi.co/api/v2/region/1 @@ -34,4 +40,24 @@ export const handlers = [ return res(ctx.json(pokemonListPg2)); } }), + + // getRegionPokemonList + rest.get('https://pokeapi.co/api/v2/region/johto', (req, res, ctx) => { + return res(ctx.json(region_johto)); + }), + rest.get('https://pokeapi.co/api/v2/location/65', (req, res, ctx) => { + return res(ctx.json(location_blackthorn_city)); + }), + rest.get('https://pokeapi.co/api/v2/location/66', (req, res, ctx) => { + return res(ctx.json(location_burned_tower)); + }), + rest.get('https://pokeapi.co/api/v2/location-area/249', (req, res, ctx) => { + return res(ctx.json(area_blackthorn_city_area)); + }), + rest.get('https://pokeapi.co/api/v2/location-area/212', (req, res, ctx) => { + return res(ctx.json(area_burned_tower_1f)); + }), + rest.get('https://pokeapi.co/api/v2/location-area/213', (req, res, ctx) => { + return res(ctx.json(area_burned_tower_b1f)); + }), ];