private cascanding parameter #1761
-
I'm trying to test a component using Edit context:
The problem her is CurrentEditContext is a private parameter. Is the a way to test it ? Or do I need to modify the visibility of CuurentEditContext (I prefer no if possible). Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Now out of the box and on top of my head there is no other way. but here is my personal salt to the topic: it seems you want to test an internal state rather than observable behaviour. probably that context (depending on its value) does something that is observable from the outside. This is probably what you wanna test. |
Beta Was this translation helpful? Give feedback.
I think your approach is the right way to go: Add an
EditForm
around. Of course, you are free to wrap your component in whatever you want inside your test. You can create separate test components that create anEditContext
and have yourInputEmail
as child component.You can, alternatively, also add a
EditContext
as part of the RenderTree: https://bunit.dev/docs/providing-input/root-render-tree.html