jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

Remove use of Hidden from materialRenderers

Open walston opened this issue 1 year ago • 4 comments

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

  1. Create a form
  2. Create a test (testing-library/react) around that form
  3. Add an assertion on any form field
  4. Call screen.debug() in the test
  5. 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

walston avatar Mar 02 '23 21:03 walston

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?

sdirix avatar Mar 09 '23 11:03 sdirix

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?

walston avatar Mar 09 '23 17:03 walston

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.

sdirix avatar Apr 20 '23 15:04 sdirix

@walston I ran into this too, here's my fix: https://github.com/eclipsesource/jsonforms/issues/2159#issuecomment-1671579773

DrewHoo avatar Aug 10 '23 13:08 DrewHoo