private cascanding parameter #1761
Answered by linkdotnet
Julien-Marpault asked this question in Q&A
-
| 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.
Answered by linkdotnet Oct 3, 2025
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.
4 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
I think your approach is the right way to go: Add an
EditFormaround. Of course, you are free to wrap your component in whatever you want inside your test. You can create separate test components that create anEditContextand have yourInputEmailas child component.You can, alternatively, also add a
EditContextas part of the RenderTree: https://bunit.dev/docs/providing-input/root-render-tree.html