Fixed Filters.test.ts
This commit is contained in:
parent
3539b6febe
commit
1d58f41b5f
@ -1,12 +1,12 @@
|
||||
import {
|
||||
useGetRegionPokemons,
|
||||
useGetRegionOptions,
|
||||
createRegionPokemonListOptionElements,
|
||||
} from './Filters';
|
||||
|
||||
describe('Filters', () => {
|
||||
describe('test utility functions', () => {
|
||||
test('createOptionElements works correctly', () => {
|
||||
const { data } = useGetRegionPokemons();
|
||||
const { data } = useGetRegionOptions();
|
||||
const optionElements = createRegionPokemonListOptionElements(data);
|
||||
expect(optionElements[0].props.children).toBe('Kanto (1-151)');
|
||||
expect(optionElements[1].props.children).toBe('Johto (152-251)');
|
||||
|
@ -31,7 +31,7 @@ export const createRegionPokemonListOptionElements = (
|
||||
});
|
||||
};
|
||||
|
||||
const useGetRegionOptions = () => {
|
||||
export const useGetRegionOptions = () => {
|
||||
const data: RegionPokemonRange[] = [
|
||||
{ region: 'kanto', startId: 1, endId: 151 },
|
||||
{ region: 'johto', startId: 152, endId: 251 },
|
||||
|
Loading…
x
Reference in New Issue
Block a user