You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Take an example of a normal chart, now I want to test on passing correct data and options, Is it rendering or not?
You can have a look on attached code sandbox link https://mge2h.csb.app/
Looking at your codesandbox, I'd probably test App by asserting that it shallow-renders a GroupBar and a GroupApexBar.
Testing GroupedBar and GroupApexBar, however, aren't particularly easy, because they're wrapping DOM-only non-component charting libraries.
GroupApexBar, at least, is only using useState, so you can shallow-render it and assert it's rendering a ReactApexChart with the expected props.
GroupedBar is harder, because of the useEffect. You could try mount-rendering it, but all you can really do is assert that it renders a canvas. You can't (and shouldn't) be testing what the actual charting library does.
I'd suggest using a charting library that's written natively in React, rather than merely abstracting around a non-React one.
No description provided.
The text was updated successfully, but these errors were encountered: