-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix renderRows when using in a testing environment #4214
Conversation
Signed-off-by: Sebastian Malton <sebastian@malton.name>
I would like to include some form of unit test with this but all the tests I see in the repo are using I ran into this while writing some tests for an application. |
Another option could be to utilize https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren but I would need to check if that works |
From MDN:
Imho the question is - why is this even an issue for you? What would |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot use innerHTML as we need to be trusted types compliant. This is a very common thing to do so the testing framework should implement it.
What do you mean by "types compliant"? But since this does work in real browsers I am starting to suspect that |
@Nokel81 it's a security feature that allows locking down dangerous APIs such as |
@Tyriar Would you accept a PR that uses |
@Nokel81 yeah that's fine since it should be just as fast I believe |
Okay cool thanks will do then |
I'd also recommend reporting an issue to support |
Yes I have already testing-library/react-testing-library#1146, though looking through the issue boards it might actually be an issue with |
Done: #4217 |
Signed-off-by: Sebastian Malton sebastian@malton.name