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
Hello, there.
I need help in understanding how to write unit tests (Jest) for component which contains useField/Field component.
In documentation I saw that it is possible use provide(...), but it is not really good described how to use it.
Also I went through discussions and found that for example I can mock useField implementation itself. But this also looks like inventing wheel.
Can someone help with it and show how it should look like (mocking form context for component)?
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.
-
Hello, there.
I need help in understanding how to write unit tests (Jest) for component which contains useField/Field component.
In documentation I saw that it is possible use
provide(...)
, but it is not really good described how to use it.Also I went through discussions and found that for example I can mock useField implementation itself. But this also looks like inventing wheel.
Can someone help with it and show how it should look like (mocking form context for component)?
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions