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've built a component that used radix-ui that I am attempting to write some snapshot tests because the component can take many shapes. However @radix-ui/react-id causes tests to produce different ids if tests are added or removed. I've mocked react's useId but that doesn't seem to have any effect on the radix wrapper around it. I also attempted to mock radix-ui/react-id directly but that doesn't seem to have any effect.
Is it possible to mock the ids so they are stable?
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
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've built a component that used radix-ui that I am attempting to write some snapshot tests because the component can take many shapes. However
@radix-ui/react-id
causes tests to produce different ids if tests are added or removed. I've mocked react'suseId
but that doesn't seem to have any effect on the radix wrapper around it. I also attempted to mockradix-ui/react-id
directly but that doesn't seem to have any effect.Is it possible to mock the ids so they are stable?
This is how I'm attempting to mock them
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions