Closed marcosapj2 closed 2 years ago
The print of the tests running separately:
You're global state change per react-redux
is bleeding into the other test.
This is either because you don't reset it properly or because your debounced state changes happen during the next test.
@testing-library/user-event
version: 12.8.3Testing Framework and version: Jest 26.6.0
DOM Environment: JSDOM 16.7.0
Relevant code or config
What you did:
react-app-rewired test PokemonList
What happened:The tests are breaking, bringing the following feedback:
```javascript FAIL src/containers/PokemonList/__tests__/PokemonList.test.tsx (8.03 s) PokemonList √ should change items when search (741 ms) × should render the list of pokemons (1041 ms) ● PokemonList › should render the list of pokemons expect(received).toBeInTheDocument() received value must be an HTMLElement or an SVGElement. Received has value: nullVR Pokedex
Peris
Peraxoq
Reproduction repository: https://github.com/marcosapj2/vrpokedex
Problem description: When I run the tests together they break, but when I run them one by one they work normally. What is happening is that the "userEvent.type(input, 'per')" shown above is somehow affecting the other test, causing the request return wrong
Suggested solution: I don't know yet, I thought the cleanup would help but it already happens automatically