Replies: 2 comments
-
Hi,
If you want to assert that the correct values are displayed on the chart, one way to do this is to interact with the chart to open the popover. For example:
|
Beta Was this translation helpful? Give feedback.
-
More complete test example, actually switching between the different data points:
One important thing to keep in mind is that what our test utils offer is essentially an interface to the actual UI as presented to the user, so that when you say "get the values inside of a line chart (or any chart)", this only makes sense insofar these values are shown somewhere in the UI. |
Beta Was this translation helpful? Give feedback.
-
I am trying to Unit Test my application where I would want to get a specific y-value given an x-value. But taking it one step at a time, how would I get the values inside of a line chart (or any chart)?
Below is my test:
The
<DummyLineChart />
component is just the default line chart from the component's playground.Beta Was this translation helpful? Give feedback.
All reactions