-
Notifications
You must be signed in to change notification settings - Fork 914
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
Full DOM rendering test fails at react-quill component. #434
Comments
Hi! I am using Jest and I have setupTests.js file where I put global mocks. This code helped me with the same problem...
|
Referencing Enzyme guide to mock DOM, the rendering failed due to the following line. query instanceof HTMLElement Update: Issue due to
|
I get this error with Jest + react-testing-library... not sure how to move forward |
You need a MutationObserver polyfill - Jest's JSDOM env is old to maintain Node 4 support. You can install this or poyfill manually: https://github.com/ianschmitz/jest-environment-jsdom-fourteen You may also need other polyfills depending on the environment - see the tests for this library itself: https://github.com/zenoamaro/react-quill/tree/master/test/polyfills |
Thank you but it cause another error, anyone know how to solve it?
I'm using custom html toolbar btw. |
@syokujinau , I'm also facing same issue. have you resolved it? |
@vineet-agrawal96 Not yet bro, im still trying. |
Same issue could anyone help me to resolve please |
This fixed things for me
|
Updating to Jest v25 (manually updating the JSDOM environment to JSDOM v14+) will include the necessary APIs by default |
@lyctw I realize this was awhile ago but did you end up finding a solution for when you have a custom toolbar? I'm also receiving the error of the |
@labkey-nicka I fixed this today by installing jest |
@alita-moore Yes, I'm using jest as well but was unable to get it to work for a custom toolbar. |
@aemc Did you ever get this figured out? I'm having the same problem. I tried @adambaialiev 's solution of mocking
|
Has anyone been able to solve it? I also have the following error:
|
我也遇到了,但是我解决了,指定modules参数的时候,挂载container的id需要不一样的,否则会引起冲突 |
I'm using
react-quill
component in my app. Everything works fine except tests. I was writing some unit tests for my components. When I test my App component to simply render the app (using Enzyme's mount method), it fails rendering Quill component. Here is output:React-Quill version
1.3.2
To reproduce:
react-quill
componentreact-quill
component somewhere in your appenzyme
to your appThe text was updated successfully, but these errors were encountered: