Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failed sometimes #4

Open
kelilipan opened this issue Dec 27, 2021 · 0 comments
Open

Test failed sometimes #4

kelilipan opened this issue Dec 27, 2021 · 0 comments

Comments

@kelilipan
Copy link
Owner

kelilipan commented Dec 27, 2021

I was trying to test "Pokemon detail page" if the pokemon is not valid.
this is the current implementation but sometimes it failed (https://github.com/svspicious/pkdx/runs/4640514833?check_suite_focus=true)
https://github.com/svspicious/pkdx/blob/0ddc742701e5daa24e523ffd79c45763dcd7ac42/src/__tests__/pages/pokemon-detail.test.tsx#L79-L80

The problem is We need to wait useEffect to finish fetch "mock" data then render "NotFound" but sometimes findByRole failed to find "Not found".

Reference:
https://github.com/svspicious/pkdx/blob/main/src/pages/pokemon-detail.tsx
https://github.com/svspicious/pkdx/blob/main/src/__tests__/pages/pokemon-detail.test.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant