You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I create rederresult with act<RenderResult> and try to find some elements on the screen.
This, with other buttons, is called like 6 times in this one test
What happened:
We migrate our code from andt4 to antd5. As we did this we noticed a lot of our test time out. They time out, because getByRole() takes a lot of time. Sure, Antd is part of the problem, but the rendered result is a rendered result and that should work. The Test, I send in the reproduction part, is just rendering, with some fetchMocks, so no UI changes after the setup.
Reproduction:
I tried to create a good reproduction, but with all our setup code, its complex. So I created a playground with the actual screen render.
getByRole() takes a lot of time in this jest test. I used the profiler to get a feeling, on how long.
As you can see, for one getByRole() it takes around 1.6second. This adds up and leads to tests, that time out.
Suggested solution:
make getByRole fast 😅 I read a lot in the past weeks and someone said, this is slow (coudn't find the Issue again, sorry). I guess this could be improved.
cc @MLB00N
The text was updated successfully, but these errors were encountered:
@testing-library/react
version: 13.4.0Relevant code or config:
What you did:
I create rederresult with
act<RenderResult>
and try to find some elements on the screen.This, with other buttons, is called like 6 times in this one test
What happened:
We migrate our code from andt4 to antd5. As we did this we noticed a lot of our test time out. They time out, because
getByRole()
takes a lot of time. Sure, Antd is part of the problem, but the rendered result is a rendered result and that should work. The Test, I send in the reproduction part, is just rendering, with some fetchMocks, so no UI changes after the setup.Reproduction:
I tried to create a good reproduction, but with all our setup code, its complex. So I created a playground with the actual screen render.
https://testing-playground.com/gist/dcc46780eeacb3579d7b790f7fb4e577/c9e236ee04cfd77a19d8bb773e295010ed319ddb
Problem description:
getByRole()
takes a lot of time in this jest test. I used the profiler to get a feeling, on how long.As you can see, for one getByRole() it takes around 1.6second. This adds up and leads to tests, that time out.
Suggested solution:
make
getByRole
fast 😅 I read a lot in the past weeks and someone said, this is slow (coudn't find the Issue again, sorry). I guess this could be improved.cc @MLB00N
The text was updated successfully, but these errors were encountered: