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 had the same problem. I'm using Jest/React Testing Library. And other truncate libraries have the same issue. We couldn't find yet a proper way to test components using truncation.
I have a component like this:
Basically it's a chip with max width, but if the label is too long then we truncate the text, but show the full label in a tooltip.
This is working fine in the browser, but I'm getting weird behaviour when trying to write tests for this.
I have jest/enzyme tests that look like this:
But the Chip text will always display as
example 1...
. This regardless of how short or long the passed in text is.If I do a debug of that component we can see that the Truncate looks like:
With the span with ellipsis showing.
What's going on here? I'm suprised that no one else in the issues has mentioned anything like this.
The text was updated successfully, but these errors were encountered: