Pokémon Search App Glitch

Hello, I’ve encountered a pretty frustating issue where every test passes (and I do mean every test) but there’s one that doesn’t and it makes no sense:
" When the #search-input element contains an invalid Pokemon name and the #search-button element is clicked, an alert should appear with the text "Pokémon not found" ."

Which is weird since, the test " When the #search-input element contains the value Red and the #search-button element is clicked, an alert should appear with the text "Pokémon not found"" does pass
glitch1

I’ve tried testing my code on VSCode and it LITERALLY works, the alarms are there. I tried using “window.alert”, “alert” even passing them a const as parameters but nothing works, apparently, the “Red” test passes but not “hgjzuighzuhgu”

Could you share your code?

nevermind, I fixed the issue, I used both freecodecamp’s pokeapi and the real pokeapi

1 Like

Sounds frustrating to encounter such a specific issue with your tests. Sometimes these things can be tricky to debug, especially when the code behaves differently in different environments. Have you tried logging the values or steps in your test to see where they might diverge from expectations? Sometimes that can reveal unexpected behavior.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.