Replies: 2 comments 1 reply
-
We tend to rely on higher level tests that run in real browsers like Cypress, and visual regression tests using Chromatic but maybe others can offer their perspective. |
Beta Was this translation helpful? Give feedback.
0 replies
-
2.5 years later it's still the problem |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have ran into a pickle here when composing Jest unit tests for my components that consume Radix UI components: I get a lot of warning messages even though the tests are passing, e.g.:
Let's say I want to verify that the number of items rendered in a dropdown menu is correct. The following example is of course highly simplified (in reality, we pass items as an array and its length may vary + some are disabled, which necessitates asserting that the right number of items are indeed rendered):
This triggers many warnings in the terminal:
Of course I can wrap everything in
act()
, but it feels like a code smell to me:I have tried to look at if there are any unit tests written for your DropdownMenu component, but it seems like there is none. However I do see that you have some written for the Dialog component, and I wonder if you've ran into similar issues before—and if you did, how did you get about fixing it?
Beta Was this translation helpful? Give feedback.
All reactions