-
Notifications
You must be signed in to change notification settings - Fork 158
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
How to test with React? createTextRange error #61
Comments
You can use https://www.cypress.io :D |
I think the createTextRange it's failing on is from here. It seems like jsdom simply haven't implemented any of the methods. Looks like it's an open request though. Jsdom isn't anything that's officially supported by TinyMCE so I would expect that you would encounter more issues even if you would get past that one. You can set the base_url in Tiny so this might be of help with your second issue. The issue is one related to your setup though and isn't anything I can say anything for certain about. |
It is a shame that a product you are paying for (not a small amount) can not provide any way to be tested in React which is a requirement for any serious development team. Being forced to exclude tinyMCE components from test coverage is one way to solve it but I don't see why investing a couple of developer hours to make the library testable, to at least be able to input text and see if callbacks are executed, is a big deal for a company developing tinyMCE. |
@vedran-passendo |
I'm trying to test the editor with Jest and React Testing Library, which uses jsdom.
When I run my test I receive the following error:
TypeError: doc.body.createTextRange is not a function
How can I fix it?
Also, is it possible to mock the skin and content css paths, because in the test I'm receiving the following error:
Error: Could not load link: "http://localhost/assets/skins/content/default/content.min.css"
The text was updated successfully, but these errors were encountered: