jsonforms
jsonforms copied to clipboard
Remove use of Hidden from materialRenderers
Describe the bug
the use of @mui/material/Hidden
to toggle UI causes issues in test that need to be mocked (see #1795). Additionally Hidden has been deprecated. Mui docs recommend switching the JS implementation (which is used by jsonforms) to a ternary.
https://mui.com/material-ui/migration/v5-component-changes/#hidden
Expected behavior
Testing form contents should be possible
Steps to reproduce the issue
- Create a form
- Create a test (testing-library/react) around that form
- Add an assertion on any form field
- Call
screen.debug()
in the test - Note the jsonforms container is empty
Screenshots
No response
In which browser are you experiencing the issue?
testing-library/react
Which Version of JSON Forms are you using?
v3.0.0
Framework
React
RendererSet
Material
Additional context
No response
Thanks for the report! I agree, we should try to get rid of the now deprecated Hidden component. Would you like to contribute this change?
I would personally love to, but am unable to because I have an M1 mac and the system requirements don't seem to be compatible enough for me to run the test suite.
any advice on that?
The tests also run whenever a PR is opened on the CI servers. I did not test for a while but the Material UI Tests should also run on Mac, so that should not be a problem. If there is one you can always use a Linux container.
@walston I ran into this too, here's my fix: https://github.com/eclipsesource/jsonforms/issues/2159#issuecomment-1671579773