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
I haven't been successful yet in writing tests for this scenario. For some reason, not able to trigger click event on the SVGElement through react testing library. I spent significant amount of time on this.
Other alternative, I was thinking is to mock 'Edge' component to render foreignObject with button so vitest can fire click event. I would like to avoid mocking of Edge and possibly Add components. I haven't tried this yet.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to write tests for the scenario mentioned at https://reaflow.dev/?path=/story/demos-edges--adding
I was able to assert on the number of 'add' icons rendered using className.
Now, I would like to test the callback passed to onAdd prop for Edge component.
<Canvas nodes={nodes} edges={edges} edge={<Edge add={} onAdd={(event, edge) => { }...../>
I haven't been successful yet in writing tests for this scenario. For some reason, not able to trigger click event on the SVGElement through react testing library. I spent significant amount of time on this.
Other alternative, I was thinking is to mock 'Edge' component to render foreignObject with button so vitest can fire click event. I would like to avoid mocking of Edge and possibly Add components. I haven't tried this yet.
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions