react-json-editor icon indicating copy to clipboard operation
react-json-editor copied to clipboard

inputComponents not rendering for nested properties

Open bananafunctor opened this issue 10 years ago • 0 comments

As seen on https://github.com/bananafunctor/react-json-editor/commit/487ca3d333eb035ce3abfa4204939173e872525f specifically the test for nested inputComponents, they will fail to render right now.

Relevant code below

it('should render nested inputComponent', () => {
      const TestComponent = React.createClass({
          render() {
            return <p className="test">Hello, world!</p>;  
          }
      });

      const handlers = {
          testComponent : TestComponent
      };

      const nestedSchema = {
          "properties": {
              "Test": {
                  "x-hints": {
                      "form": {
                          "inputComponent": "testComponent"
                      }
                  }
              }
          }
      };
      const renderedForm = TestUtils.renderIntoDocument(<Form schema={nestedSchema}
                                                              handlers={handlers}/>);

      const paragraph = TestUtils.findRenderedDOMComponentWithClass(renderedForm, "test");

      expect(TestUtils.isCompositeComponentWithType(paragraph, TestComponent));
  })

bananafunctor avatar Jan 28 '16 11:01 bananafunctor