From 89b5b976e1512739f61dfca2e45f598982eb01d1 Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Sun, 2 Apr 2023 21:07:53 +1000 Subject: [PATCH] Removed getRegionPokemonList endpoint and related tests --- src/features/Pokedex/Filters/Filters.test.ts | 8 +- src/features/Pokedex/Filters/Filters.tsx | 59 +- src/features/Pokedex/RegionPokemonsList.json | 34 - .../Pokedex/__test__/pokedexApi.test.ts | 12 - .../responses/area_blackthorn-city-area.json | 1036 --------- .../responses/area_burned-tower-1f.json | 1090 ---------- .../responses/area_burned-tower-b1f.json | 1868 ----------------- .../responses/location_blackthorn-city.json | 36 - .../responses/location_burned-tower.json | 40 - .../__test__/responses/region_johto.json | 74 - src/features/Pokedex/pokedexApi.ts | 63 - src/mocks/handlers.ts | 27 - 12 files changed, 33 insertions(+), 4314 deletions(-) delete mode 100644 src/features/Pokedex/RegionPokemonsList.json delete mode 100644 src/features/Pokedex/__test__/responses/area_blackthorn-city-area.json delete mode 100644 src/features/Pokedex/__test__/responses/area_burned-tower-1f.json delete mode 100644 src/features/Pokedex/__test__/responses/area_burned-tower-b1f.json delete mode 100644 src/features/Pokedex/__test__/responses/location_blackthorn-city.json delete mode 100644 src/features/Pokedex/__test__/responses/location_burned-tower.json delete mode 100644 src/features/Pokedex/__test__/responses/region_johto.json diff --git a/src/features/Pokedex/Filters/Filters.test.ts b/src/features/Pokedex/Filters/Filters.test.ts index b6b04bb..ec23ef0 100644 --- a/src/features/Pokedex/Filters/Filters.test.ts +++ b/src/features/Pokedex/Filters/Filters.test.ts @@ -1,9 +1,13 @@ -import { createOptionElements } from './Filters'; +import { + useGetRegionPokemons, + createRegionPokemonListOptionElements, +} from './Filters'; describe('Filters', () => { describe('test utility functions', () => { test('createOptionElements works correctly', () => { - const optionElements = createOptionElements(); + const { data } = useGetRegionPokemons(); + const optionElements = createRegionPokemonListOptionElements(data); expect(optionElements[0].props.children).toBe('Kanto (1-151)'); expect(optionElements[1].props.children).toBe('Johto (152-251)'); expect(optionElements[2].props.children).toBe('Hoenn (252-386)'); diff --git a/src/features/Pokedex/Filters/Filters.tsx b/src/features/Pokedex/Filters/Filters.tsx index b5e5d9e..33114b7 100644 --- a/src/features/Pokedex/Filters/Filters.tsx +++ b/src/features/Pokedex/Filters/Filters.tsx @@ -1,8 +1,5 @@ import React, { useEffect } from 'react'; -import { - useGetTypeListQuery, - useGetRegionPokemonListQuery, -} from 'features/Pokedex/pokedexApi'; +import { useGetTypeListQuery } from 'features/Pokedex/pokedexApi'; import { setSelectedRegion, setSelectedType, @@ -10,7 +7,6 @@ import { setFetchingRegionPokemonList, } from 'features/Pokedex/pokedexSlice'; import { useAppDispatch, useAppSelector } from 'app/hooks'; -import RegionPokemonList from 'features/Pokedex/RegionPokemonsList.json'; const useGetSortOptions = () => { const sortOptions = [ @@ -20,20 +16,31 @@ const useGetSortOptions = () => { return { data: sortOptions }; }; -interface RegionPokemonIdRange { +export const useGetRegionPokemons = () => { + return { + data: [ + { region: 'kanto', startid: 1, endid: 151 }, + { region: 'johto', startid: 152, endid: 251 }, + { region: 'hoenn', startid: 252, endid: 386 }, + { region: 'sinnoh', startid: 387, endid: 493 }, + { region: 'unova', startid: 494, endid: 649 }, + { region: 'kalos', startid: 650, endid: 721 }, + { region: 'alola', startid: 722, endid: 809 }, + { region: 'galar', startid: 810, endid: 898 }, + ], + }; +}; + +export type RegionPokemonRange = { + region: string; startid: number; endid: number; -} +}; -interface RegionPokemonListData { - [key: string]: RegionPokemonIdRange; -} - -const regionPokemonListData: RegionPokemonListData = RegionPokemonList; - -export const createOptionElements = () => { - const data = regionPokemonListData; - return Object.entries(data).map(([region, { startid, endid }]) => { +export const createRegionPokemonListOptionElements = ( + data: RegionPokemonRange[], +) => { + return data.map(({ region, startid, endid }) => { const value = `${region}`; const label = `${ region.charAt(0).toUpperCase() + region.slice(1) @@ -61,8 +68,9 @@ const Filters = () => { const { data: typesData, isLoading: typesLoading } = useGetTypeListQuery(); const { data: sortOptions } = useGetSortOptions(); + const { data: regionPokemonListData } = useGetRegionPokemons(); - // Send the first region as the default selected region + // Action when loading the component useEffect(() => { const initailRegion = Object.keys(regionPokemonListData)[0]; if (initailRegion) { @@ -90,22 +98,9 @@ const Filters = () => { } }, [typesData]); - const selectedRegion = useAppSelector(state => state.pokedex.selectedRegion); - - const { refetch: refetchRegionPokemonList } = useGetRegionPokemonListQuery( - selectedRegion, - { skip: !selectedRegion }, + const optionElements = createRegionPokemonListOptionElements( + regionPokemonListData, ); - - useEffect(() => { - if (selectedRegion) { - dispatch(setFetchingRegionPokemonList(true)); - refetchRegionPokemonList(); - dispatch(setFetchingRegionPokemonList(false)); - } - }, [selectedRegion, refetchRegionPokemonList]); - - const optionElements = createOptionElements(); return ( <>
diff --git a/src/features/Pokedex/RegionPokemonsList.json b/src/features/Pokedex/RegionPokemonsList.json deleted file mode 100644 index 50d87f3..0000000 --- a/src/features/Pokedex/RegionPokemonsList.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Kanto": { - "startid": 1, - "endid": 151 - }, - "Johto": { - "startid": 152, - "endid": 251 - }, - "Hoenn": { - "startid": 252, - "endid": 386 - }, - "Sinnoh": { - "startid": 387, - "endid": 494 - }, - "Unova": { - "startid": 495, - "endid": 649 - }, - "Kalos": { - "startid": 650, - "endid": 721 - }, - "Alola": { - "startid": 722, - "endid": 809 - }, - "Galar": { - "startid": 810, - "endid": 898 - } -} diff --git a/src/features/Pokedex/__test__/pokedexApi.test.ts b/src/features/Pokedex/__test__/pokedexApi.test.ts index 4e4dbd4..ce5e472 100644 --- a/src/features/Pokedex/__test__/pokedexApi.test.ts +++ b/src/features/Pokedex/__test__/pokedexApi.test.ts @@ -114,17 +114,5 @@ describe('pokedexApi', () => { // @ts-ignore expect(pokemonListData?.previous).toBeUndefined(); }); - - // TODO: decide whether remove these test handlers, as logic of getting Pokemon List for a Region is no longer correct - test('query getRegionPokemonList for johto 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 deleted file mode 100644 index 6ce28f2..0000000 --- a/src/features/Pokedex/__test__/responses/area_blackthorn-city-area.json +++ /dev/null @@ -1,1036 +0,0 @@ -{ - "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 deleted file mode 100644 index 59f0b7c..0000000 --- a/src/features/Pokedex/__test__/responses/area_burned-tower-1f.json +++ /dev/null @@ -1,1090 +0,0 @@ -{ - "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 deleted file mode 100644 index 49ad105..0000000 --- a/src/features/Pokedex/__test__/responses/area_burned-tower-b1f.json +++ /dev/null @@ -1,1868 +0,0 @@ -{ - "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 deleted file mode 100644 index 98291ad..0000000 --- a/src/features/Pokedex/__test__/responses/location_blackthorn-city.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "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 deleted file mode 100644 index 4516602..0000000 --- a/src/features/Pokedex/__test__/responses/location_burned-tower.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "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 deleted file mode 100644 index bff8e09..0000000 --- a/src/features/Pokedex/__test__/responses/region_johto.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "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 8d5a752..84c909b 100644 --- a/src/features/Pokedex/pokedexApi.ts +++ b/src/features/Pokedex/pokedexApi.ts @@ -66,68 +66,6 @@ export const pokedexApi = createApi({ getArea: builder.query({ query: IdOrName => ({ url: `location-area/${IdOrName}` }), }), - // TODO: decide whether remove this endpoint, as logic of getting PokemonList for a region is no longer correct - getRegionPokemonList: builder.query({ - async queryFn(regionIdOrName, api) { - api.dispatch(setFetchingRegionPokemonList(true)); - - // 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, - }; - }), - ), - ); - - api.dispatch(setFetchingRegionPokemonList(false)); - - return { data: Array.from(pokemonDataList) }; - }, - }), }), }); @@ -140,5 +78,4 @@ export const { useGetTypeQuery, useGetAreaQuery, useGetLocationQuery, - useGetRegionPokemonListQuery, } = pokedexApi; diff --git a/src/mocks/handlers.ts b/src/mocks/handlers.ts index 173bc79..631f321 100644 --- a/src/mocks/handlers.ts +++ b/src/mocks/handlers.ts @@ -5,12 +5,6 @@ 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 @@ -40,25 +34,4 @@ export const handlers = [ return res(ctx.json(pokemonListPg2)); } }), - - // getRegionPokemonList - // TODO: decide whether remove these test handlers, as logic of getting Pokemon List for a Region is no longer correct - 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)); - }), ];