-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Log from .logTestingPlaygroundURL is to big and not working #974
Comments
Thanks for the feedback. Without a repro it'll be hard to find out why the URLs are sometimes bigger than usual. Could you provide a repro that we can use for debugging? |
Hello @eps1lon ! |
As little code as possible but enough to reproduce the described issue. Ideally cloneable considering opying code around so that it's reproducible is error-prone and takes time. |
Closing since no repro was provided. |
I get this error all the time. To reproduce it you just need to render a component big enough. For some our tests we have to render a huge component which results in a lot of HTML. I guess the HTML is encoded in the URL somehow and that's why the URL is too big. Example:
|
We've come across this issue in our codebase, most of our tests now have components that are too big and cannot see them in the playground |
Yes, we're using |
Hello everyone, this is an old one from me huh? Thanks. |
Opening the link just doesn't work. I get an empty testing playground with no HTML at all. |
Any chance to get an example here? For the example attached above I do see the HTML at the left. |
@MatanBobi Here's an example
|
Based on a short debug scenario, the length of the |
Was anyone able to find a fix here? I am also getting the same error with rendering components that are too large |
Getting the same, pretty annoying :( |
Getting the same issue, we use SVGs a lot and they quickly eat up the size of the HTML such that only 1 or 2 SVGs are needed to break it. Sadly we use a design system and I cannot alway comment these out of the code for the HTML to be small enough. |
This is good context. If that's the case most people experience, we might be able to expose an API to remove some elements from the DOM before building the URL. Is this something that might be beneficial? |
A repro was provided in #974 (comment), @eps1lon or @MatanBobi could you reopen this issue please? |
After investing a lot of hours and comparing strings, I finally found out. Its not related to React Testing Library, rather its related to Dom Testing Library. And its not the issue of encoded string, rather its the issue with printing the string on terminal. Somehow when we do What works:
I would love to fix it in Dom Testing Library, but I am not able to find a way other than |
Hello everybody.
When using
screen.logTestingPlaygroundURL()
Sometimes the generated URL is to big and when you paste it in the browser. the playground just stays empty, I found it to be random aswell, sometimes the same component generates a really big URL, and other times a smaller one, wich works, but it's kinda luck related on that one, sometimes i have to re-run my test for 5 to 10 times to get a URL that works.
I use this feature for making easier to find elements on the screen that will be used on my test, and the best queries to get to them, since the playground is great for that.
My component for the related test that this issue occurs is quite big, maybe thats the problem?
Any idea on how to make it work on bigger components, or should i try a diferent aproach?
Thanks!
The text was updated successfully, but these errors were encountered: