Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing mxGraph with react-testing-library

I'm using mxGraph library in React App. I need to create unit tests for components that draw graph. I'm using jest and react testing library. But this library cannot render out mxGraph's elements. Maybe because, while testing it cannot define screen resolution, and render out properly.

Is it possible to test mxGraph drawings or is there any examples or practices with it?

like image 619
Abdulbosid Avatar asked Jul 26 '26 15:07

Abdulbosid


1 Answers

I don't think RTL is the best tool for this kind of testing. It does not compute any graphical value like height and width of the elements or their positions. I would suggest you use something like Cypress for this kind of tests

like image 159
Giorgio Polvara - Gpx Avatar answered Jul 29 '26 09:07

Giorgio Polvara - Gpx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!